faqts : Computers : Programming : Languages : PHP : Database Backed Sites : MySQL

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

2 of 13 people (15%) answered Yes
Recently 2 of 10 people (20%) answered Yes

Entry

mysql_query with INSERT creates TWO new records without apparent reason (like while or so).

Mar 6th, 2002 20:20
Narendra Jain, Tobias Schwarz,


You are executing the insert query twice in your code, viz.
   if ($all_ok) {
      mysql_query($insert_quiery);
   } else {
      echo "Error";
   }
   ...
   ...
   mysql_query($insert_query);