Hi, I am attempting to query a table of 3 fields, I am trying to select name,definition from table terms where the first letter in name is = to a character i specify, a php variable if you will.
I have tried:
$sql3 = "SELECT *, LEFT(name,1) as name1
FROM terms
WHERE name1 = '$char'
ORDER BY name1";
which generates the mysql error of cannot execute.
I have also tried:
$sq3 = "SELECT name, definition
FROM terms
WHERE SUBSTRING(name,1) = '$char' ORDER BY name";
which doesnt seem to yield any results.
Any suggestions? thanks much!
I have tried:
$sql3 = "SELECT *, LEFT(name,1) as name1
FROM terms
WHERE name1 = '$char'
ORDER BY name1";
which generates the mysql error of cannot execute.
I have also tried:
$sq3 = "SELECT name, definition
FROM terms
WHERE SUBSTRING(name,1) = '$char' ORDER BY name";
which doesnt seem to yield any results.
Any suggestions? thanks much!