There are snippets where sql code that gets evaluated by the system and executed.
If I browse the front end of the site as an admin, I get an db connection error, derived of the code in the snippets. The snippets show a connection string with a certain db server, but this error is showing a totally different db server than specified in the connection string in the snippet (a database server called weink.net)
Typical Error
<h4>A PHP Error was encountered</h4>
<p>Severity: Warning<br />
Message: mysql_connect() [<a href="http://function.mysql-connect">function.mysql-connect</a>]: Access denied for user 'reelabilities_mu'@'weink.net' (using password: YES)<br />
Filename: libraries/Functions.php(659) : eval()'d code<br />
Line Number: 30</p>
<p></div><div></p>
<h4>A PHP Error was encountered</h4>
<p>Severity: Warning<br />
Message: mysql_select_db(): supplied argument is not a valid MySQL-Link resource<br />
Filename: libraries/Functions.php(659) : eval()'d code<br />
Line Number: 32</p>
<p></div>I’ve searched the database and code for weink.net and found nothing. No idea where this is coming from.
Saving the snippet fixes the problem for all users, until the admin browses the front end again, upon which the errors start again.
An example of the snippet code is here (with actual database values replaced)
<?php
$conx = mysql_connect("SERVER HERE","USER HERE","PASSWORD HERE");
mysql_select_db("DB NAME HERE",$conx);
$cities = mysql_query("select * from exp_channel_titles where channel_id='119' and status = 'open' order by title asc");
while($city = mysql_fetch_object($cities))
{
$style="";
$site_short_name = "{site_short_name}";
if($site_short_name == $city->url_title)
{
$style = "style=\"color:#F90\"";
}
echo
'
<div class="city"><a class="city">url_title . '.reelabilities.org"><span>'.$city->title.'</span></a></div>
';
}
?>