Iv got my insert and search script ready.
its just when i insert Zeb and insert something similar like Zeb2.
When i then try to search for say Zeb, it gives me the first title Zeb but lists the text from both Zeb and Zeb2
My search script:
PHP Code:
<?php
if (isset($_POST['searchfor']) && trim($_POST['searchfor']) != '')
{
texter();
$searchfor = addslashes($_POST['searchfor']);
$sql="SELECT title, text FROM texts,details WHERE texts.textid=details.textid AND title LIKE '%".$searchfor."%';";
$result=mysql_query($sql, $conn);
if(mysql_affected_rows()>0)
{
echo "Följande poster hittades:<br /><br />";
while($row = mysql_fetch_array($result))
{
$details = $row['title'];
$texts = $row['text'];
printf("<B>%s</B><br /><textarea name=text COLS=80 ROWS=20>%s<textarea/>", $details, $texts);
}
mysql_free_result($result);
}
else
echo "Inga poster hittades.<br /><br />";
}
?>
</html>