Jump to content

Search MYSQL script help


drapet

Recommended Posts

hello

 

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

 

<?php

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>

 

help!!!!

 

regards

Link to comment
https://forums.phpfreaks.com/topic/224193-search-mysql-script-help/
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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.