$sql = mysql_query("SELECT * FROM articles WHERE `trusted` = 0 AND `catid` = $catid ORDER BY `title` ASC LIMIT $from, $max_results");
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.
$sql = mysql_query("SELECT * FROM wow WHERE `trusted` = 0 AND `catid` = $catid AND left($row['title'],1) = `A` ORDER BY `title` ASC LIMIT $from, $max_results");
if (!empty($_GET['letter']) && in_array($_GET['letter'], range('a', 'z')))
{
$letter = $_GET['letter'];
} else
{
$letter = false;
}
if ($letter)
{
$result = mysql_query("SELECT `field` FROM `table` WHERE `title` LIKE '$letter%'");
}
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
$sql = mysql_query("SELECT * FROM wow WHERE `trusted` = 0 AND `catid` = $catid AND left(`title`,1) = `A` ORDER BY `title` ASC LIMIT $from, $max_results");
This $row['title'] in the SQL query is very wrong ...
There are 10 types of people in this world, those who understand binary and those who don't