php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33098 mysql_fetch_array(mysql_query("mysql query here")) crashes
Submitted: 2005-05-22 01:06 UTC Modified: 2005-05-22 13:13 UTC
From: tloudimm at go2 dot pl Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 4.3.11 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tloudimm at go2 dot pl
New email:
PHP Version: OS:

 

 [2005-05-22 01:06 UTC] tloudimm at go2 dot pl
Description:
------------
hi there. i found a bug [well, i think it's a bug, it onced  crashed my apache server].. found it in 4.3.10 first, than in 4.3.11 again. anyway, here's some sample code:

<?
mysql_connect($host,$user,$pass);
mysql_select_db(some_db);

while($mysql_answer = mysql_fetch_array(mysql_query("SELECT * FROM some_table"))
 {
  //do something - there goes a crash
 }
?>

however
<?
mysql_connect($host,$user,$pass);
mysql_select_db(some_db);

$mysql_query = mysql_query("SELECT * FROM some_table");
while($mysql_answer = mysql_fetch_array($mysql_query)
 {
  //do something - nothing bad happens here
 }
?>

i searched bug database and found nothing like my observations. sorry if i make too much mess - delete my report if so :) greetings.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-05-22 10:17 UTC] tloudimm at go2 dot pl
sorry for making unnecessary mess - friend of mine told me that in the first code there is an infinite loop.. sorry once again
 [2005-05-22 13:13 UTC] tony2001@php.net
.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 07:01:33 2025 UTC