Selecting PHP variables from joined tables

trapysteari

New Member
I am still trying to learn PHP and have some issues with this code. I have a field $youtubeurl in ID_Vehicles and I am trying to output some code if that field has data in it how do I select that field with this join to output the value like the sample below?\[code\] function getDealerSettings($vid) { include('db.php'); $query = "SELECT banner, ebay_htmlcss FROM ebay_dealersettings INNER JOIN ID_vehicles ON ebay_dealersettings.did=ID_vehicles.did WHERE vid='".$vid."'"; $result = @mysql_query($query); if ($result) { $row = mysql_fetch_assoc($result); return array("banner" => trim($row['banner']), "css" => str_replace(array("\n", "\t"), " ",$row['ebay_htmlcss'])); } return ""; } function getTemplate($vid) { $code = ""; extract($this->getDealerSettings($vid)); if (!empty($youtubeurl)) $code .= "$youtubeurl";\[/code\]
 
Back
Top