Re: Query stopping after 2 records?
| From: | Chris | Date: | Mon, 27 Apr 2009 22:32:13 +0000 |
| Subject: | Re: Query stopping after 2 records? | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-46148@lists.php.net to get a copy of this message | ||
Hawx wrote:
On Mon, 27 Apr 2009 07:19:23 -0700, "Miller, Terion" <tmiller@springfi.gannett.com> wrote:No - use the mysql_real_escape_string function. Addslashes is the wrong thing to use here. -- Postgresql & php tutorials http://www.designmagick.com/I need help/advice figuring out why my query dies after 2 records. Hereisthe query:wnumber,// Build your INSERT statement here$query = "INSERT intowarrants(wid, name, age, warrant, bond,crime) VALUES (";Make sure any apostrophes in the variable strings are escaped correctly. Check the addslashes() function.$query .= " '$wid', '$name', '$age', '$warrant','$bond', '$wnumber', '$crime' )";$wid = mysql_insert_id();// run querymysql_query($query) or die ("GRRRRRRR");echo $query; It inserts two records and dies half way thru the 3rd? Thanks in advance for clues to fix this. T.Miller