Link to home
Start Free TrialLog in
Avatar of DS928
DS928Flag for United States of America

asked on

MySQL CONCAT problems

I am trying to output the results of this query.  I have been playing around with it all day.  I am getting results except for the CONCAT field, Here is the query.

$query="SELECT tblRestaurants.RestName,
CONCAT(tblLocations.StreetNumber,' ', tblLocations.Street)
FROM tblRestaurants INNER JOIN tblLocations ON tblRestaurants.RestID = tblLocations.RestID
	WHERE tblLocations.CuisineID='$Doggie'
	GROUP BY tblLocations.RestID and tblRestaurants.RestName
	ORDER BY tblRestaurants.RestName ASC";

Open in new window


and the results...
<?php
$i=0;
while ($i < $num) {
$f1=mysql_result($result,$i,"RestName");
$f2=mysql_result($result,$i,"[CONCAT(tblLocations.StreetNumber,'  ', tblLocations.Street)]");
?>

Open in new window


It has to be in the syntax?
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DS928

ASKER

Spot on!