Re: catch the error

From: Date: Thu, 26 Feb 2009 17:34:03 +0000
Subject: Re: catch the error
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-288839@lists.php.net to get a copy of this message
Hi PJ, Could it be that you have "//include ("lib/db1.php"); " commented out? Try uncommenting that line and see what happens. The error message will always print because the query is never executing properly if you have the db connections file commented out. On Thu, Feb 26, 2009 at 12:28 PM, PJ <af.gourmet@videotron.ca> wrote: > What is wrond with this file? same identical insert works from console > but not from this file :-( > > <html> > <head> >    <title>Untitled</title> > </head> > > <body> > <? > //include ("lib/db1.php");    // Connect to database > mysql_connect('biggie', 'user', 'password', 'test'); > $sql1 = "INSERT INTO example (name, age) VALUES ('Joe Blow', > '69')"; > $result1 = mysql_query($sql1,$db); > if (!$result1) { >  echo("<P>Error performing 1st query: " . >       mysql_error() . "</P>"); >  exit(); > } > ?> > > </body> > </html> > > Seems to be good to print out the error message, but that's all. db not > written. > > -- > > Phil Jourdan --- pj@ptahhotep.com >   http://www.ptahhotep.com >   http://www.chiccantine.com > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe:    3Û|8Cl] ŠWo~ > ¤jhttp://lists.mysql.com/mysql?unsub=dsteplight@gmail.com > >

« previous php.general (#288839) next »