close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues


Dynamic link creation from a search results page

Thread began 5/03/2010 11:23 am by freiheit | Last modified 5/04/2010 9:53 am by Jason Byrnes | 665 views | 1 replies |


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">

<input type="text" name="search" id="search" />
<input type="submit" name="submit" id="button" value="submit" />

/* search code */

// 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());

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'];

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?

Sign in to reply to this post

Jason ByrnesWebAssist

you would change this line:

echo "Date $row_result[date] found.<br> Clink HERE to see all the data related to this date".$row_result['date'];

to something like:

echo "Date ".$row_result['date'] ." found.<br> Clink <a href=\"page.php?date=".$row_result['date'] ."\">HERE</a> to see all the data related to this date".$row_result['date'];
Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...