Re: [PHP] mysql if empty

2007-04-11 Thread Jim Lucas
tedd wrote: At 5:53 PM -0700 4/10/07, Jim Lucas wrote: Anyways, here is the expanded version hopefully to your liking. # Your request failed. Make up your own custom way of displaying the error. } else { if ( mysql_num_rows($results) > 0 ) { while ( $row = mysql_fetch_assoc(

Re: [PHP] mysql if empty

2007-04-11 Thread tedd
At 5:53 PM -0700 4/10/07, Jim Lucas wrote: Anyways, here is the expanded version hopefully to your liking. # Your request failed. Make up your own custom way of displaying the error. } else { if ( mysql_num_rows($results) > 0 ) { while ( $row = mysql_fetch_assoc($res

Re: [PHP] mysql if empty

2007-04-10 Thread tg-php
Top-posting is sublime. Embrace it. Why scroll through 10 pages of emails you've already read when you can get to the meat of it all in the first few lines of an email? :) Plus trying to quickly separate all the previous replies from the latest one when some emailers indent, indent with lead

Re: [PHP] mysql if empty

2007-04-10 Thread Robert Cummings
On Tue, 2007-04-10 at 20:48 -0500, Richard Lynch wrote: > No. > > Despite the fact that I replied to your message as it was the "last" > one, and that caused threaded mail readers to place my post directly > under yours as a "reply", my comment was not specifically directed at > your post. > > I

Re: [PHP] mysql if empty

2007-04-10 Thread Richard Lynch
No. Despite the fact that I replied to your message as it was the "last" one, and that caused threaded mail readers to place my post directly under yours as a "reply", my comment was not specifically directed at your post. I had deleted the "way wrong" posts by the time I realized I wanted to say

Re: [PHP] mysql if empty

2007-04-10 Thread Jim Lucas
[EMAIL PROTECTED] wrote: Turn on MAGIC QUOTES and REGISTER GLOBALS Once you've done that, install Postgres. Run your MySQL command again, Postgres has much better error reporting and will assist in debugging the situation. You might consider replacing your javascript functions with PHP ones

Re: [PHP] mysql if empty

2007-04-10 Thread Jim Lucas
Richard Lynch wrote: I am amazed by the sheer number of just plain WRONG answers to this one... Were they all from April 1 or something?... so, are you saying that my answer was wrong, or just making a statement. If my answer was wrong, it was because it was too simple, which is what I was tr

Re: [PHP] mysql if empty

2007-04-10 Thread tg-php
Turn on MAGIC QUOTES and REGISTER GLOBALS Once you've done that, install Postgres. Run your MySQL command again, Postgres has much better error reporting and will assist in debugging the situation. You might consider replacing your javascript functions with PHP ones since JS can sometimes int

Re: [PHP] mysql if empty

2007-04-10 Thread Lori Lay
Richard Lynch wrote: I am amazed by the sheer number of just plain WRONG answers to this one... Were they all from April 1 or something?... Yes it's unfortunate. I think part of the problem was that several people, including myself, weren't entirely clear on what he was after. When I re

Re: [PHP] mysql if empty

2007-04-10 Thread Richard Lynch
I am amazed by the sheer number of just plain WRONG answers to this one... Were they all from April 1 or something?... -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP Gen

Re: [PHP] mysql if empty

2007-04-10 Thread Richard Lynch
$result == "" means: Your SQL query is so f'ed up, I couldn't even run it. It does NOT mean: Your query returned zero rows, a perfectly normal and common condition. You want http://php.net/mysql_num_rows And, actually, $result is FALSE, not really "", when the query is wrong. On Mon, April 9, 2

Re: [PHP] mysql if empty

2007-04-10 Thread Jim Lucas
[EMAIL PROTECTED] wrote: If I search for something in mysql that returns an empty result I cant get it to return "No result found" always returns "Found" even though the recoed does not exist... $sql = "SELECT Client FROM booked WHERE Name = 'larry'"; $result = mysql_query($sql); if ($resul

Re: [PHP] mysql if empty

2007-04-10 Thread tedd
At 10:18 PM +0100 4/9/07, <[EMAIL PROTECTED]> wrote: If I search for something in mysql that returns an empty result I cant get it to return "No result found" always returns "Found" even though the recoed does not exist... $sql = "SELECT Client FROM booked WHERE Name = 'larry'"; $result = my

Re: [PHP] mysql if empty

2007-04-09 Thread Satyam
ssage - From: <[EMAIL PROTECTED]> To: Sent: Monday, April 09, 2007 11:18 PM Subject: [PHP] mysql if empty If I search for something in mysql that returns an empty result I cant get it to return "No result found" always returns "Found" even though the recoed does not ex

Re: [PHP] mysql if empty

2007-04-09 Thread Paul Novitski
At 4/9/2007 02:18 PM, [EMAIL PROTECTED] wrote: If I search for something in mysql that returns an empty result I cant get it to return "No result found" always returns "Found" even though the recoed does not exist... $sql = "SELECT Client FROM booked WHERE Name = 'larry'"; $result = mysql_que

Re: [PHP] mysql if empty

2007-04-09 Thread Davi
Em Segunda 09 Abril 2007 18:27, Lori Lay escreveu: > [EMAIL PROTECTED] wrote: > > If I search for something in mysql that returns an empty result I cant > > get it to return > > "No result found" always returns "Found" even though the recoed does > > not exist... > > > > > > $sql = "SELECT Client F

Re: [PHP] mysql if empty

2007-04-09 Thread Lori Lay
[EMAIL PROTECTED] wrote: If I search for something in mysql that returns an empty result I cant get it to return "No result found" always returns "Found" even though the recoed does not exist... $sql = "SELECT Client FROM booked WHERE Name = 'larry'"; $result = mysql_query($sql); if ($resul

Re: [PHP] mysql if empty

2007-04-09 Thread afan
> If I search for something in mysql that returns an empty result I cant get > it to return > "No result found" always returns "Found" even though the recoed does not > exist... > > > $sql = "SELECT Client FROM booked WHERE Name = 'larry'"; > > $result = mysql_query($sql); > > if ($result == "") >

[PHP] mysql if empty

2007-04-09 Thread chris
If I search for something in mysql that returns an empty result I cant get it to return "No result found" always returns "Found" even though the recoed does not exist... $sql = "SELECT Client FROM booked WHERE Name = 'larry'"; $result = mysql_query($sql); if ($result == "") { echo "No result