Page 1 of 1

Caching problem..?

Posted: Mon Jan 28, 2013 1:54 pm
by nervino
Hello, I made a php page that queries a MySQL db and outputs the result of a simple query.

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 change with phpmyadmin the value of mail_to field, and I refresh the php page, I can't see the new value and the old one is displayed instead. To see the actual result of the query, I have to upload again the php file.

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>';
}
Environment:
Ubuntu server 12.04
cmsms 1.11.3
php 5.3

Re: Caching problem..?

Posted: Mon Jan 28, 2013 3:56 pm
by calguy1000
including 'include.php' is not a supported way of interfacing with CMSMS.

And no, it's not a caching issue.

Re: Caching problem..?

Posted: Mon Jan 28, 2013 8:16 pm
by nervino
I see. Thank you