If I ever get great at php its going to be entirely because of you guys with all the advice Im getting here. And on that note, Im back for more  !
I have two different pages with essentially the same problem:
PHP Code:
$query = " SELECT* FROM mreleased WHERE name LIKE '$letsel%'".
PHP Code:
$result = mysql_query("SELECT * FROM mreleased WHERE genre='$pqualifier' ORDER BY name") or die(mysql_error());
In the first one it just looks for any name that starts with the given letter. Then for the second it orders the list by name within the subcategory.
My problem is that since this is a database of movies there is the incredibly irritating occurence of movie titles starting with the word 'The'. Now I could retrieve the entire database and then use php to remove 'The' and then (assuming there is a command to order in php, i havent looked yet) sort by name in PHP. But seeing as mysql already does the sorting/searching for me I would rather avoid that.
Is it possible to search for and cancel out part of a sql string?
Like SELECT * FROM mreleased WHERE name!='The %' & WHERE name LIKE'$letsel%'
That last line was just me fishing, from what Ive read you cant even have '&' in a mysql statement but hopefully that gives you an idea of what Im trying to achieve.
Thanks,
Truly.
|