Hi I am trying to make a sql call to another data base using a snippet, but it does not return a value even though there is a value.
I used a static php page and it does return the value but when I put it into modx nothing returns.
$database_server = ’’;
$database_user = ’’; //Both user and name are the same for consistency.
$database_password = ’’;
$baseurl = ’[[++site_url:stripString=`http://`:stripString=`www.`:stripString=`/`:stripString=`modx.`]]’;
$con = mysql_connect($database_server,$database_user,$database_password);
mysql_select_db($database_user, $con);
$keys = mysql_query("select apikey from googleapikeys where domain=’$baseurl’");
while ($row = mysql_fetch_assoc($keys))
{
return $baseurl;
}
mysql_close($con);
please help someone.