Topic awaiting preservation: Determine if a WHILE function is empty (Page 1 of 1) |
|
---|---|
Paranoid (IV) Inmate From: 127.0.0.1 |
posted 06-20-2002 16:33
I have a MySQL fetch line like this: |
Bipolar (III) Inmate From: Berlin (almost) |
posted 06-20-2002 16:43
I have no idea if there is a specific function/property that tells you if there are any results, but couldn't you do something like: |
Lunatic (VI) Mad Scientist From: Massachusetts, USA |
posted 06-20-2002 16:52
If there's a way to get the length of the array returned by mysql_fetch_array($result), then you can compare that and see if it's greater than zero. |
Maniac (V) Mad Scientist From: Rochester, New York, USA |
posted 06-20-2002 22:37 |
Maniac (V) Mad Scientist From: Belgrade, Serbia |
posted 06-21-2002 06:39 |
Paranoid (IV) Inmate From: New Jersey, USA |
posted 06-22-2002 02:00
You could also use code: if (!$result = mysql_query($sql))
|