Bug #17981: list() unable to set back boolean trigger
| From: | a dot nichau at digitale-zeiten dot de | Date: | Tue, 25 Jun 2002 20:45:52 +0000 |
| Subject: | Bug #17981: list() unable to set back boolean trigger | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-12074@lists.php.net to get a copy of this message | ||
From: a.nichau@digitale-zeiten.de
Operating system: Linux 2.4.18
PHP version: 4.1.2
PHP Bug Type: *Programming Data Structures
Bug description: list() unable to set back boolean trigger
I tried several methods to read out the three newest articles in our cms
separated from other news tables. In short I query the first news table
list the output and query the next table.
<?
$sql="SELECT CONCAT(b.title,' ',b.link) as
titel,b.id,DATE_FORMAT(b.Creation_Date,'d.m.Y') as datum FROM news AS
b,members AS a WHERE a.id='$id' AND b.Author_Name=CONCAT(a.vorname,'
',a.name) ORDER BY Modify_Stamp DESC LIMIT 3";
$rs=mysql_query($sql) or die(mysql_error());
while(list($titel,$id,$datum) = mysql_fetch_array($rs)){?>
<?=$datum?>, <a href="/magazin/<? echo $id?>/"
target="_blank"><?=$titel?></a><br/>
<? } ?>
<hr noshade size="1"/>
<?
mysql_free_result($rs);
mysql_close();
include(CONNECT);
$sql="SELECT b.title as titel,b.id,DATE_FORMAT(b.Creation_Date,'d.m.Y')
as datum FROM news_box AS b,members AS a WHERE a.id='$id' AND
b.Author_Name=CONCAT(a.vorname,' ',a.name) ORDER BY Modify_Stamp DESC
LIMIT 3";
$rs2=mysql_query($sql) or die(mysql_error());
while($myrow = mysql_fetch_array($rs2)){?>
<?=$myrow[datum]?>, <a href="/journal/<? echo $myrow[id]?>/"
target="_blank"><?=$myrow[titel]?></a><br/>
<? }
mysql_close();
} ?>
The Bug is that the second loop isn´t started due to the loop-trigger
already set to false. Even renaming variables and using different db
connections didn´t solve the problem. Queries are ok and separated from
another they bring the right resultset. Hope this was clear enough for
you.
--
Edit bug report at http://bugs.php.net/?id=17981&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=17981&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=17981&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=17981&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=17981&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=17981&r=support
Expected behavior: http://bugs.php.net/fix.php?id=17981&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=17981&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=17981&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=17981&r=globals