mysql - PHP - Remove Apostrophe from POST varible -


इस सवाल का पहले से ही एक उत्तर है: < / p>

  • 28 जवाब

    मैंने एक फ़ॉर्म बनाया है PHP और MySQL डेटा जमा करने के बाद, यह MySQL तालिका में सहेजा जाता है। लेकिन मुझे एक समस्या मिल गई है: यदि फ़ॉर्म में कोई एपॉस्ट्रॉफी है, तो डेटा डालने के दौरान एक त्रुटि होगी, तो मैं पोस्ट चर से एपॉस्ट्रॉफी कैसे निकाल सकता हूं?

      $ description = $ _POST [ 'विवरण'];    

    आपको अपने एसक्यूएल स्टेटमेंट को तोड़ने से रोकने के लिए, वर्णों से बचने की आवश्यकता है। मैं सुझाव है कि आप एसक्यूएल इंजेक्शन पर पढ़ें। मुझे लगता है कि यह MySQLi एक्सटेंशन में स्वचालित रूप से ध्यान रखा जाता है, जिसे आप उपयोग करना चाहिए क्योंकि इस पद्धति का आजकल घिस रहा है। <पूर्व> $ descrtion = mysql_real_escape_string ($ _ POST ['वर्णन']);

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -