Numeric Directory Search problem
Posted: Thu Oct 21, 2010 6:39 am
Hello friends,
I am designing directory pages where companies' names can be searched alphabetically. I created pages for each alphabet and created some link has A | B | C | D | E ..........................X | Y | Z | 0-9
When the visitor click on any alphabet, he will be taken to the page where companies' names that start with that alphabet are listed. 0-9 will lead to the page where companies' name that start with numbers are listed. I use the code below to get the results from my database.
for A Page
for B Page
for C Page etc
but when i tried the below for numeric page, it didn't work
i also tried
and
what can i do? pls help me
I am designing directory pages where companies' names can be searched alphabetically. I created pages for each alphabet and created some link has A | B | C | D | E ..........................X | Y | Z | 0-9
When the visitor click on any alphabet, he will be taken to the page where companies' names that start with that alphabet are listed. 0-9 will lead to the page where companies' name that start with numbers are listed. I use the code below to get the results from my database.
Code: Select all
$sql = mysql_query("SELECT * FROM $com_name WHERE com_name LIKE 'A%'");Code: Select all
$sql = mysql_query("SELECT * FROM $com_name WHERE com_name LIKE 'B%'");Code: Select all
$sql = mysql_query("SELECT * FROM $com_name WHERE com_name LIKE 'C%'");but when i tried the below for numeric page, it didn't work
Code: Select all
$sql = mysql_query("SELECT * FROM $com_name WHERE com_name LIKE '0%, 1%, 2%, 3%, 4%, 5%, 6%, 7%, 8%, 9%'");Code: Select all
$sql = mysql_query("SELECT * FROM $com_name WHERE com_name LIKE '0-9%'");Code: Select all
$sql = mysql_query("SELECT * FROM $com_name WHERE com_name LIKE '0%' OR '1%' OR '2%' OR '3%' OR '4%' OR '5%' OR '6%' OR '7%' OR '8%' OR '9%'");