select from.... - strange result
| From: | Martin Samesch | Date: | Sat, 25 Mar 2000 00:27:16 +0000 |
| Subject: | select from.... - strange result | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-12581@lists.php.net to get a copy of this message | ||
Hi,
could this be a bug:
With
---snip---
$table = "Species";
$condition = "gattung='g13' && art='a13' &&
u_art='ua13'";
$query = "SELECT spec_id FROM $table WHERE $condition";
$result = @mysql_db_query($database,$query);
$row = mysql_fetch_array($result);
var_dump($row);
---snip---
var_dump($row) produces
array(2) { [0]=> string(1) "6" ["spec_id"]=> string(1) "6" }
whereas on the commandline with
mysql> select spec_id from Species where gattung='g13' &&
art='a13' && u_art='ua13';
I get the expected result:
+---------+
| spec_id |
+---------+
| 6 |
+---------+
1 row in set (0.01 sec)
Where could this [0]=> string(1) "6" come from?
Still PHP4.0b4pl1
TIA
Martin