Jump to content

Search MYSQL script help


Recommended Posts



  I have a problem with php mysql search script.

The script works great, only the inability to link results with page.


script looks like this:

<form action="rezult.php" method="post">

Search: <input type="text" name="term" /><br />

<input type="submit" name="submit" value="Submit" />



mysql_connect ("localhost", "user","pass")  or die (mysql_error());

mysql_select_db ("name");

$term = $_POST['term'];

$sql = mysql_query("select * from radio where titel like '%$term%'");

while ($row = mysql_fetch_array($sql)){

echo 'ID: '.$row['ID'];

echo '<br/> Radio '.$row['titel'];

echo '<br/> '.$row['grad'];

echo '<br/>  '.$row['Beschrijving'];

echo '<br/><br/>';




I have to link the result with a link:

<a href = "http: / / domain.com / sender / '. $ row [' ID']/'.$ row ['titel']. html"> Radio '. $ row [' titel '] </ a>





Link to comment
Share on other sites

When I try to link like this


echo '<br/><a href = "http://domain.com/sender/'.$row['id']/'.$row['titel'].html">Radio '.$row['titel']</a>;

        echo '<br/>'.$row['grad'];

echo '<br/>'.$row['beschrijving'];

echo '<br/><br/>';

I get an error:

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in *************/result.php on line 13


the same line where is the link code

Link to comment
Share on other sites

This thread is more than a year old. Are you sure you have something important to add to it?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.