Here is my php file:
Code: Select all
$docroot = $_SERVER['DOCUMENT_ROOT'];
require $docroot . DIRECTORY_SEPARATOR . 'include.php';
if (!isset($gCms)) exit;
$db = cmsms()->GetDb();
$query = "SELECT * FROM mytable";
$dbresult = $db->Execute( $query );
while ($dbresult && $row = $dbresult->FetchRow())
{
$mail_to = $row['mail_to'];
echo '<br>to: '.$mail_to.'<br><br>';
}
If I do not include cmsms files, and I make a standard connection to MySQL (see below), all works fine and the actual result of the query is displayed.
May anybody help me to understand where is the trick?
Thanks a lot
Standard connection that works:
Code: Select all
$username = "user";
$password = "pass";
$hostname = "localhost";
$dbhandle = mysql_connect($hostname, $username, $password);
$selected = mysql_select_db("mydb",$dbhandle);
$dbresult = mysql_query("SELECT * FROM mytable");
while ($row = mysql_fetch_array($dbresult)) {
$mail_to = $row['mail_to'];
echo '<br>a: '.$mail_to.'<br><br>';
}
Ubuntu server 12.04
cmsms 1.11.3
php 5.3