Re: insert into mysql

From: Date: Thu, 25 Jan 2001 20:02:48 +0000
Subject: Re: insert into mysql
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-6178@lists.php.net to get a copy of this message
> //--------------------------- Add part ---------------------------------- > if($act=="ADD"){ > $sql="INSERT INTO ecomm (ID,part) VALUES ('$sid','$spp'),$db"; > if(! @mysql_db_query("$sql")){ > echo("Unable to add part."); mysql_close($db);exit();} } > > Why does this not work? > You're INSERT query is wrong. Take the ',$db' off the end. $sql = "INSERT INTO ecomm (ID,part) VALUES ('$sid','$spp')"; - Darryl ---------------------------------------------------------------------- Darryl Friesen, B.Sc., Programmer/Analyst Darryl.Friesen@usask.ca Education & Research Technology Services, http://gollum.usask.ca/ Department of Computing Services, University of Saskatchewan ---------------------------------------------------------------------- "Go not to the Elves for counsel, for they will say both no and yes"

« previous php.db (#6178) next »