Dynamic link creation from a search results page
hi there,
I made a small search engine to look for data in a mysql database , and then display them.
The problem i have is that i want to make a link to every record that is being displayed that leads to a record page.
/* form code */
<form action="search.php" method="get">
<p>
<input type="text" name="search" id="search" />
<input type="submit" name="submit" id="button" value="submit" />
</p>
</form>
-------------------------------------------------------------------------------------
/* search code */
<?php
// get data
$button = $_GET['submit'];
$search = $_GET['search'];
if (!$button)
echo "Please choose a date.";
else {
if (strlen($search) <=8)
echo "You havent entered a date.";
else {
echo "You searched for the date <b>$search</b> <hr size='2'>";
}
}
$query = "SELECT movements.`date` FROM movements WHERE date LIKE '$search'";
$result = mysql_query($query) or die (mysql_error());
$row_result=mysql_fetch_assoc($result);
$totalRows_result=mysql_num_rows($result);
if ($search = "$totalRows_result")
echo "Date $row_result[date] found.<br> Clink HERE to see all the data related to this date".$row_result['date'];
else
echo "The date you choosed does not exists"
?>
---------------------------------------------------------------------------
Now i want from the results of this page to link to an other page. I know how to do this in html , but i dont know how in php cause i receive a lot of syntax errors which leads to parse errors.
How can i create a dynamic link in my case?