Bug when inserting sql row
Posted: Sun Apr 09, 2006 11:12 am
Jcart | Please use
for some reason, my script inserts two rows when i run it. ( the second row is full of blank values ).
Has anyone ever encountered an error like this before? I have looked at my code over and over and I cant figure out why its doing that.
Jcart | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]Code: Select all
$dbh = mysql_connect ("localhost", "teamae_mike", "pass") or die ('I cannot connect to the database because: ' . mysql_error());
mysql_select_db("teamae_negdb");
mysql_query("INSERT INTO `news` (`user`, `cont`, `date`, `title`) VALUES ('$user', '$cont', '$date', '$title')") or die(mysql_error());Has anyone ever encountered an error like this before? I have looked at my code over and over and I cant figure out why its doing that.
Jcart | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]