Welcome to WebmasterWorld Guest from 126.96.36.199
I'm trying to set-up a simple A-Z list so that people can search a mysql database by each letter. Click on "A" get all records in the DB that start with "A". I have it working no problem but i want to be able to add "#" so that the user can get all records that start with a Number.
For some reason the query i'm running won't grab any records that start with a number?
here is the query:
WHERE productName LIKE 'colname%' AND products.supplier_id = supplier.supplier_id
ORDER BY productName ASC
And the query string for the "#" is:
for each of the Letters i have
it works on the letters but not on the number?
I'm using Dreamweaver so the 'colname%' has default value of -1 and a runtime value of $_GET['index']
any ideas on changing the query to grab the records with numbers would be helpful?
Try something like the following and tell me what you get:
$query = "SELECT * FROM products,supplier WHERE productName LIKE '".[url=http://us2.php.net/mysql-real-escape-string]mysql_real_escape_string[/url]($_GET['index'])."%' AND products.supplier_id = supplier.supplier_id ORDER BY productName ASC";