@DysanauthorMar 03.2008 — #I trying to create a search script, that searches the name and gender columns contained in a database for keywords entered in a forms text box.
Why doesn't the following code work?
[CODE]<?php $con = mysql_connect("localhost","peter","abc123"); if (!$con) { die(mysql_error()); }
@chazzyMar 03.2008 — #I trying to create a search script, that searches the name and gender columns contained in a database for keywords entered in a forms text box.
Why doesn't the following code work?
[/quote]
It's not valid sql. You need to individually check each column
this is valid: <i> </i>SELECT * FROM persons WHERE name LIKE '%$keywords%' or gender like '%$keywords%';