RE: [PHP] testing a query for success--code doesnt work

2003-02-04 Thread Edward Peloke
no rows were updated."; else echo "".$affected_rows." were updated."; -Kevin - Original Message - From: "Edward Peloke" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 04, 2003 2:16 PM Subject: RE: [PHP] te

Re: [PHP] testing a query for success--code doesnt work

2003-02-04 Thread Kevin Stone
quot;".$affected_rows." were updated."; -Kevin - Original Message - From: "Edward Peloke" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 04, 2003 2:16 PM Subject: RE: [PHP] testing a query for success--code doesnt work > Just

Re: [PHP] testing a query for success--code doesnt work

2003-02-04 Thread Chris Shiflett
> * if the update does not have anything to work on > it does not mean it is a failure! except when you > EXPECTED it to update something. Right, and the function doesn't care what you expect anyway. :-) > * i'm not sure whether "if ($query)" is the proper > way to check this. for trapping d

RE: [PHP] testing a query for success--code doesnt work

2003-02-04 Thread Edward Peloke
Just grab your qu or something along those lines...but also add in your check to see if the query ran without errors. Eddie -Original Message- From: Sunfire [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 4:03 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] testing a query for

Re: [PHP] testing a query for success--code doesnt work

2003-02-04 Thread Kevin Stone
FYI, I replied to a similar problem just a few threads down. Next time please consider searching before you post. You'll find you can answer your own question 9 out of 10 times. $result = mysql_query("UPDATE or INSERT or DELETE... ") or die("Invalid query: " . mysql_error()); if (mysql_affected_

Re: [PHP] testing a query for success--code doesnt work

2003-02-04 Thread Sunfire
the record was actually updated } if i can get some code example for that...it would help tnx - Original Message - From: "Edward Peloke" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 04, 2003 3:46 PM Subject: RE: [PHP] testing a query for suc

Re: [PHP] testing a query for success--code doesnt work

2003-02-04 Thread Chris Hayes
At 21:51 4-2-2003, you wrote: hi.. posted a message about what the code was to test an update query to see if it was successfull using mysql and i tested my code and for some reason even if none of the fields were updated it still reports the success message... heres the code i have: $query=mysql

RE: [PHP] testing a query for success--code doesnt work

2003-02-04 Thread Edward Peloke
I think you want to use mysql_affected_rows -Original Message- From: Sunfire [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04, 2003 3:51 PM To: [EMAIL PROTECTED] Subject: [PHP] testing a query for success--code doesnt work hi.. posted a message about what the code was to test an upd

RE: [PHP] testing a query for success--code doesnt work

2003-02-04 Thread Edward Peloke
I believe as long as the update was successful (no errors) it will say 'message if successful'...I think you are wanting to know if rows were updated or not...not whether or not the query ran ok. Eddie -Original Message- From: Sunfire [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 04,