|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-05-07 01:50 UTC] dayseye at 21cn dot com
[2007-05-07 03:07 UTC] scottmac@php.net
[2007-05-07 09:36 UTC] admin at shadyindustries dot biz
[2007-05-07 09:39 UTC] admin at shadyindustries dot biz
[2007-05-07 12:52 UTC] scottmac@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 03 10:00:01 2025 UTC |
Description: ------------ mysql_fetch_array and mysql_fetch_assoc return empty arrays when, for the same query, mysql_num_rows returns 5 - the correct number. also notable, the mysql_affected_rows causes a server malfunction for the same query. I have tested it both on my public webserver (unix, unknown webserver, PHP 4, MySQL 4) and my home computer (Windows XP, Apache2, PHP 5, MySQL 5), thus this problem would appear to not be related to just one circumstance. The really weird thing is that phpMyAdmin can read the database perfectly. Reproduce code: --------------- <?php $con = mysql_connect("####" ,"####" ,"####"); if (!$con) { trigger_error("Unable to connect to mysql, MYSQL ERROR: " . mysql_error(),E_USER_ERROR); } if (!mysql_select_db("NuevasIslas", $con)) { trigger_error("Unable to open database, MYSQL ERROR: " . mysql_error(),E_USER_ERROR); } while($row = mysql_fetch_array(mysql_query("SELECT * FROM `jaydev_config`"))) { $config[$row['name']] = $row['value']; } print "$config"; //print mysql_fetch_array(mysql_query("SELECT * FROM `jaydev_config`")); ?> Expected result: ---------------- Array ( [enabled_login] => 0 [enabled_register] => 1 [server_name] => JayDev [url_base] => http://ni.shadyindustries.biz/jaydev/ [url_forum] => http://forum.shadyindustries.biz/viewforum.php?f=4 ) Actual result: -------------- Array