0

Requirement: Read rows from a mysql database, where one column contains an address and a city, make the resulting address into a link to google maps, by passing the address for the location only as described in the following link: is there a way to pass arguments to google map's get directions functionality? php code shippet $result = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_array($result)) { echo''.$row['DAYTIME'].''.$row['MEETINGNAME'].' '.''.$row['ADDRESSCITY'].''.''.$row['BLDGNAME'].''; } ?> The above block of code sucefully creates a link to maps.google.com BUT I want to put $row['ADDRESSCITY'] between the "http://maps.google.com/?q= and the closing " I tried this:

'<a href="http://maps.google.com/?q='.$row['ADDRESSCITY'].'/a'">'

and no results are displayed, and no error message either. Thanks

0

3 Answers 3

1

Can you try to remove the quote " just after <a href="http://maps.google.com/?q=

Sign up to request clarification or add additional context in comments.

Comments

0

Change the url to this.

echo'<tr><td>'.$row['DAYTIME'].'</td><td>'.$row['MEETINGNAME'].'</td><td>'.'<a href="http://maps.google.com/?q='.$row['ADDRESSCITY'].'">Google Maps</a>'.'</td><td>'.$row['BLDGNAME'].'</td></tr>';

Comments

0

Try this :

echo'<tr><td>'.$row['DAYTIME'].'</td><td>'.$row['MEETINGNAME'].'</td><td>'.'<a href="http://maps.google.com/?q="'.$row['ADDRESSCITY'].'"></a></td><td>'.$row['BLDGNAME'].'</td></tr>';

2 Comments

Requirement: Must open the above link in a new window. Here is what I tried, but it did not open a new window or tab (I don't care which) - those pesky single and double quotes!
echo'<tr><td>'.$row['DAYTIME'].'</td><td>'.$row['MEETINGNAME'].'</td><td>'.'<a href="google.com/….' target="_blank".'">'.$row['ADDRESSCITY'].'</a>'.'</td><td>'.$row['BLDGNAME'].'</td></tr>';

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.