Hi,
Just a short question:
If you are selecting a field from a database, where you are using LEFT() to display only the variables that match that first letter, i.e.
$query = "SELECT names FROM table WHERE LEFT(names, 1) = 'a' ORDER BY names ASC";
But within the database one of the names has quotes arround them, how would you get this to still show up that name when it is being listed?
Thank you in advance!
removing quotes from a database query
Moderator: General Moderators
Re: removing quotes from a database query
I do not know for sure, but it may works:
Code: Select all
$query = "SELECT names FROM table WHERE LEFT(names, 1) = 'a' OR LEFT(names,2) = '"a' ORDER BY names ASC";