Dear ALL,
I am using PHP+ MYSQL + APACHE
Initially in my site the user comes adn searches according to some given criterion. After that the results are displayed. Suppose i get the name of four products as results.
I want that these resutls to be hyperlinks and such that clicking on them user triggers another query the result of whihc is displayed on the next page.
I am attaching hte sample code :
<?
//$username='root';
$password='desertgot123';
$database='foodatclick';
$state=$POST['state'];
$city=$POST['city'];
echo "$state";
echo="$state"
mysql_connect(localhost,root,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT * from vendorlogin where city='$city' and state='$state' ";
$result=mysql_query($query);
$num=mysql_numrows($result);
if ($myrow = mysql_fetch_array($result))
{
echo "<table border=1>\n";
echo "<tr><td>Name</td><td>Position</td></tr>\n";
do {
printf("<tr><td>%s %s</td><td>%s</tr>\n", $myrow["company_name"], $myrow["cuisine_category"], $myrow["endtimeofdelivery"]);
} while ($myrow = mysql_fetch_array($result));
echo "</table>\n";
} else {
echo "Sorry, no records were found!";
}
mysql_close();
?>
You can see that I am displaying hte restaurant names. I get two rows of data from the query.
Restaurnat Name Cuisine category End Time Of Delivery
parantha indian 00:00:10
abcd chinese 00:00:10
1) I want that 'Parantha' and 'abcd' should be hyperlinks.Wher do i add code so that they are displayed as hyperlinks.
2) IT should be such taht when say some one clicks 'parantha', the query goes"select * from TABLE1 where restaurant='parantha' and another page is dispayed with the results.
Reagrds
Abhijeet