SQL in PHP Inserting Two Rows Instead of One -
The following code is inserting two records into my database, but I only want to put it one line two Why is it time to put it?
& lt;? If (! $ Con) {dead ('Could not connect:' Mysql_error ()); } $ I = 1; ($ I & lt; = 1) {if (isset ($ _ POST ['submit'])) {$ sql = "Customer (company, greetings, first_name, last_name, phone, email, fax, street, city, Include in the county '$ _POST [Company]', '$ _POST [Hello]', '$ _POST [first_name]', '$ _POST [last_name]', '$ _POST [phone]', '' $ _POST [fax ] '$ _POST [email]', '$ _POST [road]', '$ _POST [city]', '$ _POST [county]', '$ _POST [postcode]', '$ _POST [type]' , '$ _POST [notes]') "; If (! Mysql_query ($ sql, $ con)) {dead ('error:' mysql_error ()); }} $ I ++; }? & Gt;
On an estimate, I can say because it is being executed twice ( Not being waist - it is most likely the problem of control flow, because it does not seem to be the reason for inserting the above two.)
He said, something worrisome is that such things as input Lack of escape etc. Like: What is the purpose of the $ i variable?
Comments
Post a Comment