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. */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php