MySQL Forums
Forum List  »  Newbie

Searching my database
Posted by: Peppe World
Date: August 14, 2007 12:24PM

I want to search my database but i don't seem to get it to work.

I have this.

<?php
include "connect.php";
$search = $_POST['search'];
$query = "SELECT title FROM movies WHERE '%$search%'";
$result = mysql_query($query);
while ($row = mysql_fetch_assoc($result)){
echo $row['title']."<br>";
}
?>

What do I do wrong?

Options: ReplyQuote


Subject
Written By
Posted
Searching my database
August 14, 2007 12:24PM
August 14, 2007 01:05PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.