Re: Query/Error

From: Date: Fri, 17 May 2002 11:01:36 +0000
Subject: Re: Query/Error
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-98040@lists.php.net to get a copy of this message
On Friday 17 May 2002 17:35, Anthony Rodriguez wrote: > I've a php script that creates (inserts) a new record in a MySQL table. It > executes, goes to the next page, but it doesn update the db> > > The db name and table name are OK. I've printed the values passed to the > script and it's OK too. > > What code can I add to the script to find out the error of the query? > > Here's the script: > > <?php > > $connection=@mysql_connect("localhost","wagner","xyz") or die > ("No > connection!"); > > $db=@mysql_select_db("sbwresearch_com",$connection) or die ("No > database!"); Having a '@' in front of a function call suppresses any error messages that may occur. Reading the manual would tell you that mysql_error() returns the error from the last mysql operation. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* belief, n: Something you do not believe. */

« previous php.general (#98040) next »