Hi. I'm trying to search multiple DB fields with a Select Menu and I don't know where to start.
for example, from the code below I would like the value ='strAuthorname' to actually search the fields 'AuthorFirstName' AND 'AuthorLastName'.
<form method='post' action='{$_SERVER["PHP_SELF"]}'>
<!--select tag -->
<select name='metode' size='1' >
<option value='strTitle'>Title</option>
<option value='strMediatype'>Media Type</option>
<option value='strAuthorname'>Author</option>
</select>
<input type='text' name='search' value='{$search}' size='25'>
<input type='submit' value ='search now'></p>
</form>
<?php
if ($search !="" || $metode !="") {
// shoot off query
$res = mysql_query("SELECT * FROM tblpublications WHERE {$metode} LIKE '{$search}%'");
echo "
//results here
";
?>
Is this where I would use an array? I'm completely confused. Is this even possible?
thanks in advance!
-tom