I am using the following statement which works fine in HeidiSQL, but it is not returning any data when used in my PHP code:
$query="Select Left(SiteName, 4) from sites order by SiteName";
It works when I remove the Left function:
$query="Select SiteName from sites order by SiteName";
What am I missing?
It’s probably returning data correctly but the column (in php associative array which are you probably using) is named
Left(SiteName, 4), try using:It should work.