RE: [PHP] Re: catch the error

2009-02-27 Thread Boyd, Todd M.
> -Original Message- > From: Chris [mailto:dmag...@gmail.com] > Sent: Thursday, February 26, 2009 6:38 PM > To: Boyd, Todd M. > Cc: PHP General list > Subject: Re: [PHP] Re: catch the error > > Boyd, Todd M. wrote: > >> -Original Message- > >

Re: [PHP] Re: catch the error

2009-02-26 Thread 9el
com/nine_L www.lenin9l.wordpress.com On Fri, Feb 27, 2009 at 6:37 AM, Chris wrote: > Boyd, Todd M. wrote: > >> -Original Message- >>> From: Chris [mailto:dmag...@gmail.com] >>> Sent: Thursday, February 26, 2009 4:16 PM >>> To: Boyd, Todd M. >>> Cc: PJ; P

Re: [PHP] Re: catch the error

2009-02-26 Thread Chris
Boyd, Todd M. wrote: -Original Message- From: Chris [mailto:dmag...@gmail.com] Sent: Thursday, February 26, 2009 4:16 PM To: Boyd, Todd M. Cc: PJ; PHP General list Subject: Re: [PHP] Re: catch the error In examples sent to you, people foolishly replaced your $db var with $db_connect

Re: [PHP] Re: catch the error

2009-02-26 Thread PJ
Ashley Sheridan wrote: > On Thu, 2009-02-26 at 14:15 -0500, PJ wrote: > >> Ashley Sheridan wrote: >> >>> On Thu, 2009-02-26 at 13:56 -0500, PJ wrote: >>> >>> Ashley Sheridan wrote: > On Thu, 2009-02-26 at 13:34 -0500, Darryle Steplight wrote: >

Re: [PHP] Re: catch the error

2009-02-26 Thread PJ
Shawn McKenzie wrote: > Boyd, Todd M. wrote: > > Jesus Christ... everyone on this list must've had a long week, because > >> you guys are going blind. :D >> >> In examples sent to you, people foolishly replaced your $db var with >> $db_connect ONLY FOR PART OF THE SCRIPT. You've defined your da

RE: [PHP] Re: catch the error

2009-02-26 Thread Boyd, Todd M.
> -Original Message- > From: Chris [mailto:dmag...@gmail.com] > Sent: Thursday, February 26, 2009 4:16 PM > To: Boyd, Todd M. > Cc: PJ; PHP General list > Subject: Re: [PHP] Re: catch the error > > > > In examples sent to you, people foolishly replaced you

Re: [PHP] Re: catch the error

2009-02-26 Thread Chris
In examples sent to you, people foolishly replaced your $db var with $db_connect ONLY FOR PART OF THE SCRIPT. You've defined your database connection as $db_connect in some versions of the source, but then you reference $db (without _connect) in your mysql_select call in that same source. $db =

Re: [PHP] Re: catch the error

2009-02-26 Thread Shawn McKenzie
Boyd, Todd M. wrote: > Jesus Christ... everyone on this list must've had a long week, because > you guys are going blind. :D > > In examples sent to you, people foolishly replaced your $db var with > $db_connect ONLY FOR PART OF THE SCRIPT. You've defined your database > connection as $db_connect

Re: [PHP] Re: catch the error

2009-02-26 Thread Ashley Sheridan
On Thu, 2009-02-26 at 14:15 -0500, PJ wrote: > Ashley Sheridan wrote: > > On Thu, 2009-02-26 at 13:56 -0500, PJ wrote: > > > >> Ashley Sheridan wrote: > >> > >>> On Thu, 2009-02-26 at 13:34 -0500, Darryle Steplight wrote: > >>> > >>> > Hi PJ, > $db_host = 'biggie'; >

RE: [PHP] Re: catch the error

2009-02-26 Thread Boyd, Todd M.
> -Original Message- > From: PJ [mailto:af.gour...@videotron.ca] > Sent: Thursday, February 26, 2009 1:16 PM > To: a...@ashleysheridan.co.uk > Cc: Darryle Steplight; Ricardo Dias Marques; php-general@lists.php.net; > MySql > Subject: Re: [PHP] Re: catch the error >

Re: [PHP] Re: catch the error

2009-02-26 Thread PJ
Ashley Sheridan wrote: > On Thu, 2009-02-26 at 13:56 -0500, PJ wrote: > >> Ashley Sheridan wrote: >> >>> On Thu, 2009-02-26 at 13:34 -0500, Darryle Steplight wrote: >>> >>> Hi PJ, $db_host = 'biggie'; $db_user = 'root'; $db_pass = 'gu...@#$'; $db_name =

Re: [PHP] Re: catch the error

2009-02-26 Thread PJ
Here's the working code... Error performing 3st query: " . mysql_error() . ""); } echo $sql1; echo ""; echo $db_select; exit(); ?> This works fine either as is or using the include... :-) 9el wrote: > But the question is PJ, have you got it out of errors yet? :) > > www.twitter.com/nine_

Re: [PHP] Re: catch the error

2009-02-26 Thread Ashley Sheridan
On Thu, 2009-02-26 at 13:56 -0500, PJ wrote: > Ashley Sheridan wrote: > > On Thu, 2009-02-26 at 13:34 -0500, Darryle Steplight wrote: > > > >> Hi PJ, > >>$db_host = 'biggie'; > >> $db_user = 'root'; > >> $db_pass = 'gu...@#$'; > >> $db_name = 'biblane'; > >> > >> > >> > >> Everyone here is t

Re: [PHP] Re: catch the error

2009-02-26 Thread PJ
Ashley Sheridan wrote: > On Thu, 2009-02-26 at 13:34 -0500, Darryle Steplight wrote: > >> Hi PJ, >>$db_host = 'biggie'; >> $db_user = 'root'; >> $db_pass = 'gu...@#$'; >> $db_name = 'biblane'; >> >> >> >> Everyone here is trying to help you and that's cool, but EVERYONE on >> this list may n

[PHP] Re: catch the error

2009-02-26 Thread PJ
Jerry Schwartz wrote: > >> -Original Message- >> From: PJ [mailto:af.gour...@videotron.ca] >> Sent: Thursday, February 26, 2009 12:28 PM >> To: php-general@lists.php.net; MySql >> Subject: catch the error >> >> What is wrond with this file? same identical insert works from console >> but

Re: [PHP] Re: catch the error

2009-02-26 Thread 9el
But the question is PJ, have you got it out of errors yet? :) www.twitter.com/nine_L www.lenin9l.wordpress.com --- Use FreeOpenSourceSoftwares, Stop piracy, Let the developers live. Get a Free CD of Ubuntu mailed to your door with

Re: [PHP] Re: catch the error

2009-02-26 Thread Darryle Steplight
Additionally regarding the error handling , add this to the op of your script. ini_set("display_errors","true"); error_reporting(E_STRICT|E_ALL); and post the output of your error message. On Thu, Feb 26, 2009 at 1:40 PM, Ashley Sheridan wrote: > On Thu, 2009-02-26 at 13:34 -0500, Darryle Stepl

[PHP] RE: catch the error

2009-02-26 Thread Jerry Schwartz
>-Original Message- >From: PJ [mailto:af.gour...@videotron.ca] >Sent: Thursday, February 26, 2009 12:28 PM >To: php-general@lists.php.net; MySql >Subject: catch the error > >What is wrond with this file? same identical insert works from console >but not from this file :-( > > > >Untit

Re: [PHP] Re: catch the error

2009-02-26 Thread Ashley Sheridan
On Thu, 2009-02-26 at 13:34 -0500, Darryle Steplight wrote: > Hi PJ, >$db_host = 'biggie'; > $db_user = 'root'; > $db_pass = 'gu...@#$'; > $db_name = 'biblane'; > > > > Everyone here is trying to help you and that's cool, but EVERYONE on > this list may not be so nice. The above credentials

[PHP] Re: catch the error

2009-02-26 Thread Darryle Steplight
Hi PJ, $db_host = 'biggie'; $db_user = 'root'; $db_pass = 'gu...@#$'; $db_name = 'biblane'; Everyone here is trying to help you and that's cool, but EVERYONE on this list may not be so nice. The above credentials is definitely the type of information you want to keep private, unless you don't

Re: [PHP] Re: catch the error

2009-02-26 Thread Andrew Ballard
What does this output? $db_connect is not a valid resource: ' . mysql_error() . ''; exit(); } if (!mysql_select_db($db_name, $db_connect)) { echo "Unable to select $db_name: " . mysql_error() . ''; exit(); } $sql1 = "INSERT INTO test (name, age) VALUES ('Arnie Shwartz', '75')"; $res

[PHP] Re: catch the error

2009-02-26 Thread PJ
Darryle Steplight wrote: > ok, well if that's the case then do this > > $db = mysql_connect('biggie', 'user', 'password', 'test'); > Ashley pointed out that the 4th parameter is not right - belongs in mysql_select_db. Here it is corrected: (but it still does not work) Error performing 1st query

[PHP] Re: catch the error

2009-02-26 Thread PJ
Ricardo Dias Marques wrote: > Hi PJ, > > On Thu, Feb 26, 2009 at 17:28, PJ wrote: > > >> What is wrond with this file? same identical insert works from console >> but not from this file :-( >> >> [snip] >> >> > //include ("lib/db1.php");// Connect to database >> mysql_connect('biggie', 'use

[PHP] Re: catch the error

2009-02-26 Thread PJ
Jim Lyons wrote: > what's the error message? it's in the script/// Error performing query: of Error performing 1st query: - whatever I input. But I had an error in the include location... that's fixed and it works, but not the rest as corrected: Error performing 1st query: " . mysql_error()

[PHP] Re: catch the error

2009-02-26 Thread Ricardo Dias Marques
Hi PJ, On Thu, Feb 26, 2009 at 17:28, PJ wrote: > What is wrond with this file? same identical insert works from console > but not from this file :-( > > [snip] > > //include ("lib/db1.php");    // Connect to database > mysql_connect('biggie', 'user', 'password', 'test'); > $sql1 = "INSERT INTO

[PHP] Re: catch the error

2009-02-26 Thread Darryle Steplight
ok, well if that's the case then do this $db = mysql_connect('biggie', 'user', 'password', 'test'); That should fix the problem. On Thu, Feb 26, 2009 at 12:46 PM, PJ wrote: > It is commented out because I am using "mysql_connect" > I don't think it would be good to use both, since the db1

[PHP] Re: catch the error

2009-02-26 Thread Jim Lyons
what's the error message? On Thu, Feb 26, 2009 at 11:46 AM, PJ wrote: > It is commented out because I am using "mysql_connect" > I don't think it would be good to use both, since the db1 references > another db. But even when I use the db1.php and change the database and > table, I get the s

[PHP] Re: catch the error

2009-02-26 Thread PJ
It is commented out because I am using "mysql_connect" I don't think it would be good to use both, since the db1 references another db. But even when I use the db1.php and change the database and table, I get the same error message. But what I did miss is my typo in "What is wrond with this fi

[PHP] Re: catch the error

2009-02-26 Thread Darryle Steplight
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,