note 29795 added to function.msql-query
| From: | depi_gr at yahoo dot com | Date: | Tue, 25 Feb 2003 13:11:56 +0000 |
| Subject: | note 29795 added to function.msql-query | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-44499@lists.php.net to get a copy of this message | ||
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"];
}
}
--
http://www.php.net/manual/en/function.msql-query.php
http://master.php.net/manage/user-notes.php?action=edit+29795
http://master.php.net/manage/user-notes.php?action=delete+29795
http://master.php.net/manage/user-notes.php?action=reject+29795