Hi all,
I have a search script that displays search results in a table. and one field is displayed as a link
sql = "the select statement here works fine";
$query = mysql_query($sql);
?>
<table width="98%" BORDERCOLOR="teal" border="1" cellspacing="0" cellpadding="1">
<tr>
<td>Name</td>
<td>Category</td>
<td>Products</td>
<td>Type</td>
<td>Country</td>
<?php
while ($row = mysql_fetch_array($query)) {
echo "<tr><td><a href=\"http://www.mywebsite/display.php?name =".$row['name']."\">".$row['name']."</a></td><td>", $row['category'],"</td><td>",$row['products'],"</td><td>",$row['typeeng'],"</td><td>",$row['countryeng'],"</tr>";
}
?>
</table>
Up to here is fine. please note that the field displayed as link calls for another php file display.php , so i used $GET['name']; to pass the value of (name) to display.php as follow:
<?
$name = $GET['name'];
$db_name = "xxx";
$table_name = "xxx";
$connection = @mysql_connect("localhost", "xx", "xx")
or die("Couldn't connect.");
$db = @mysql_select_db($db_name, $connection)
or die("Couldn't select database.");
$sql = "SELECT * FROM $table_name
WHERE name = '$name'";
$result = @($sql,$connection)
or die("Couldn't execute query.");
echo (this is the question)
?>
I want to select all and display is a new small window.
My code is that of a newbie. all comments are welcome.
Regards
sinbad