Displaying title alphabetically and using $_GET
Posted: Fri Sep 14, 2007 8:46 am
I am using the following code to display the list of articles.
It now displays a maximum of $max_results on one page as per the script and ascending order of title.
Now i want to display only those articles whose title start from 'a' or 'A'
Also to make the query dependent on the $_GET . means if i pass example.com/pages.php?alphabet=d then all the articles having title starting with d should be displayed.
How to write the query?
Code: Select all
$sql = mysql_query("SELECT * FROM articles WHERE `trusted` = 0 AND `catid` = $catid ORDER BY `title` ASC LIMIT $from, $max_results");Now i want to display only those articles whose title start from 'a' or 'A'
Also to make the query dependent on the $_GET . means if i pass example.com/pages.php?alphabet=d then all the articles having title starting with d should be displayed.
How to write the query?