insert in mysql

From: Date: Thu, 25 Jan 2001 21:26:02 +0000
Subject: insert in mysql
Groups: php.db 
Request: Send a blank email to php-db+get-6193@lists.php.net to get a copy of this message
This link is passed to the shopping cart type script where I want to put the spp and the sid into the database. http://tech2000/rfq.php?spp=MC68020RC12T&pkg=PGA&mfc=MOT&act=ADD&sid=583607ba7b565b6d699da58d7c7fe9ab <script language='php'> // ------------ Connect to Database --------------------------------------- $db = mysql_pconnect("tech2000", "wwwguest", "guest"); if(!$db){echo("Unable to connect to database server. Call 815-987-2775");exit();} if(! @mysql_select_db("bruininv")){echo("Unable to select database. Call 815-987-2775");mysql_close($db);exit();} //--------------------------- Add part ---------------------------------- if($act=="ADD"){ $sql="INSERT INTO ecomm (ID,part) VALUES ('$sid','$spp')"; if(! mysql_query('$sql')){echo("Unable to add part.");mysql_close($db);exit();} } //---------------------------Close DB------------------------------- mysql_close($db); </script> returns "Unable to add part". I can manually add parts using DBTools and: INSERT INTO ecomm (ID,part) VALUES ('583607ba7b565b6d699da58d7c7fe9ab','MC68020RC12T') and the search for the parts now works... Just have to be able to add the parts and remove them from the db I'm using ConTEXT for a text editor, works great for php! Get it at http://www.fixedsys.com/context/ !!! and it's FREE!!!

« previous php.db (#6193) next »