Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

Using PHP to search a MySQL database and return information.

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Using PHP to search a MySQL database and return information.

Postby NickCB » Fri Jan 11, 2013 5:00 am

Using PHP to search a MySQL database and return information.

I am building a directory site with a Joomla component that has a Google Map facility but not up to the high standard and functionality of another map component I am using.

So, to save on work I ask this:

Within the map an info block pops up when you click the marker icon. As with Google Maps. I need information in these blocks. I have the information already in the directory database so do not want to duplicate it. To display the same information in the directory within the map block can I use the following code where it allows me to insert code and add in the relevant information:
{source}<?php
$query = $db->getQuery(true);
$query->select($db->nameQuote('something'));
$query->from('#__mydatabasetable');
$query->where($db->nameQuote('this').' = '.$db->quote('that'));
$db->setQuery($query);
$result = $database->loadResult();
?>{/source}
Does this mean I can display information from another table within the same database?

If so, I would like to do display the following:

If the ID of this Marker icon matches the ID of e.g.databaseXYZ, then enter information from databaseabc, column123.

If I can, what is the relevant information and where does it go?
NickCB
New php-forum User
New php-forum User
 
Posts: 1
Joined: Fri Jan 11, 2013 4:42 am

Return to PHP coding => General

Who is online

Users browsing this forum: Baidu [Spider] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.