Re: : request
| From: | Chris Edwards | Date: | Thu, 17 Apr 2003 13:03:06 +0000 |
| Subject: | Re: : request | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-144278@lists.php.net to get a copy of this message | ||
> what function should i use to echo in whitch row is result
I not sure there is a specific function to do what you have stated. You
must iterate through the array that mysql_fetch_array($result) produces.
You may look up other functions on php and mysql here:
http://www.php.net/manual/en/ref.mysql.php
here is the code I think your looking for:
<?php
mysql_connect('host','user','passwd');
mysql_select_db('db');
$name = "Paul";
$query = "select * from guests where name like '%$name%'";
$result = mysql_query($query);
while($row = mysql_fetch_array($result)){
for( $i = 0; $i < count($row); $i=$i+1 )
{
echo $row[$i] . " ";
}
echo "<br>\n";
}
?>
this will print out your results with each row on a new line.
--
Chris Edwards
Web Application Developer
Outer Banks Internet, Inc.
252-441-6698
chris.edwards@obinet.com
http://www.OuterBanksInternet.com