note 29795 deleted from function.msql-query by didou

From: Date: Mon, 04 Apr 2005 22:07:57 +0000
Subject: note 29795 deleted from function.msql-query by didou
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-87460@lists.php.net to get a copy of this message
Note Submitter: depi_gr at yahoo dot com ---- You can have two queries or more in one php file and use a variable from one query to another $result1=mysql_query("select * from news", $link); if ($row=mysql_fetch_array($result1)){ $stored_id=$row["id"]; $stored_title=$row["title"]; $stored_text=$row["text"]; $x=-1; while ($row=mysql_fetch_array($result1)) { $x++; } $y=$x-3; } $result2=mysql_query("select * from news where id>$y", $link); if ($row=mysql_fetch_array($result2)){ $stored_id=$row["id"]; $stored_title=$row["title"]; $stored_text=$row["text"]; while($row=mysql_fetch_array($result2)) { echo $row["id"]; echo $row["title"]; echo $row["text"]; } }

« previous php.notes (#87460) next »