hi all i got a search script but it dosnt work when i use a variable
this is it when it works (tn is random but returns expected results)
$post = $_POST['search_box'];
$sql = "SELECT `id`, `to`, `from`, `subject`, `body`, `date`, `new` FROM `privatemail` WHERE `from` LIKE CONVERT(_utf8 \'%tn%\' USING latin1) COLLATE latin1_swedish_ci";
$result = mysql_query($sql) or die("Query failed");
here using $post witch prints out the with echo fine but dosnt work inside the search results for sql.
$post = $_POST['search_box'];
$sql = "SELECT `id`, `to`, `from`, `subject`, `body`, `date`, `new` FROM `privatemail` WHERE `from` LIKE CONVERT(_utf8 \'%$post%\' USING latin1) COLLATE latin1_swedish_ci";
$result = mysql_query($sql) or die("Query failed");
Another thing i would like to know is if i also wanted the search to do more than just search one thing how would i do it?