Re: query error

From: Date: Sun, 05 May 2002 08:00:02 +0000
Subject: Re: query error
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-18978@lists.php.net to get a copy of this message
On Sunday 05 May 2002 14:44, erich wrote: > when i perform query an mysql db, to insert a new record, the PHP says: > > Warning: Supplied argument is not a valid MySQL result resource in > g:\wwwroot\phpusermanager-1.0\add_order.php on line 24 > > the snippet is as follows > <? > // connect to the database > $conn = mysql_connect ($db_host, $db_user, $db_passwd); > > // select database > mysql_select_db ($db_used, $conn); > > // SQL statement > $query = "INSERT into order (Ctr_no, OID, Person_in_charge, Source, > Destination, Status) > VALUES ('$container_num', '$order', '$referrer', > '$source', '$dest', > '$status')"; > mysql_query ($query, $conn); > > mysql_close($conn); > ?> > > why the argument isn't valid? how to solve this problem? Find out why by putting in some error checking code. See examples in manual and check out mysql_error(). -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* Your computer account is overdrawn. Please reauthorize. */

« previous php.db (#18978) next »