PDA

Click to See Complete Forum and Search --> : [RESOLVED] change from number to title


c_owl
May 27th, 2010, 12:14 PM
i would like to search by title on my web page and not numbers.
how can i do this

im using below to search by numbers
$id = "%".$_GET["search"]."%";


$result = mysql_query( "SELECT vidnumber, titleid, hd, year,starring1,videotitle,starring2, directedby, filmplot1,dirid,starrid1,starrid2, trilogy,age, Runningtime FROM videolist WHERE vidnumber LIKE '".mysql_real_escape_string($id)."'")

or die(mysql_error());
while($row = mysql_fetch_array($result)){
echo $row['videotitle'];

kows
May 27th, 2010, 12:37 PM
change the WHERE clause in your SQL statement to look in the title field instead of the 'vidnumber' field, more specifically in this piece of code:
WHERE vidnumber LIKE '".mysql_real_escape_string($id)."'"

c_owl
May 27th, 2010, 12:50 PM
thanks kows.. missed that.
been learning vs2010 .net aswell