ewel
12-11-2008, 11:55 PM
Sometimes I need to do something with MySQL and then I look around for examples and get by. Like this I made the below bit of code. But I am wondering if there is a better way to do this? Now I have two queries and it would be nicer if it were possible to do it in one go. Unfortunately I don't know enough to know where to look for answers myself..
Here is what I have:
$query = "SELECT 'locid' FROM #__eventlist_events WHERE 'id'=".$id;
$database->setQuery($query);
$venueid = $database->loadResult();
$query = "SELECT 'street','plz','city','state','country' FROM #__eventlist_venues WHERE 'id'=".$venueid;
$database->setQuery($query);
$el_address = $database->loadResult();
Thanks in advance for your suggestions!
Here is what I have:
$query = "SELECT 'locid' FROM #__eventlist_events WHERE 'id'=".$id;
$database->setQuery($query);
$venueid = $database->loadResult();
$query = "SELECT 'street','plz','city','state','country' FROM #__eventlist_venues WHERE 'id'=".$venueid;
$database->setQuery($query);
$el_address = $database->loadResult();
Thanks in advance for your suggestions!