Hello everyone,
I'm working on Magento Enterprise v1.9.0.0.
I need to connect to the database and run SQL directly to query tables.
Here is what I've used to do that.
I have Magento Community v1.4.1.1 and Magento Enterprise v1.9.0.0 installed on my local computer.PHP Code:$query = "...SQL QUERY...";
$databaseConnection = Mage::getSingleton('core/resource')->getConnection('core_read');
$result = $databaseConnection->fetchAll($query);
So in order to test, I've run the above code on my local machine, and all works fine.
But it doesn't work on live server.
Magento Enterprise v1.9.0.0 is installed on the live server and online store is running.
All works fine on live store and nothing special happens.
But I've uploaded this code to the server, it doesn't work.
And further, I can't get any PHP/MySQL error message.
Here is more detailed codes which I used to track run time.
I can be sure there is no error on SQL statement.PHP Code:// Debug Output
$this->OutputDebugLogo("<br/>");
$this->OutputDebugLogo("<br/><h3>Query : </h3>#", $query);
$databaseConnection = Mage::getSingleton('core/resource')->getConnection('core_read');
$result = $databaseConnection->fetchAll($query);
// Debug Output
$this->OutputDebugLogo("<br/><h3>Result : </h3>#", $result);
$this->OutputDebugLogo("<br/>");
And the function OutputDebugLogo() is made by myself to output debug message with variables.
Here is what I've got after running this script on my local machine.
And here you can see what I've got on the live server.PHP Code:Query :
' SELECT ... FROM ... WHERE ... '
Result:
array ( 0 => array ( 'items' => a:2:{s:3:"MEN";a:11:{s:9:... )
As you can see, there is no PHP/MySQL error message.PHP Code:Query :
' SELECT ... FROM ... WHERE ... '
And we can say the script wass stopped running at database code block.
I can't make any progress to find the main cause.
Why did it happen?
Can anyone know it?
I'm really looking forward to getting help from everyone.
Best Regards,
Floppy



LinkBack URL
About LinkBacks


Bookmarks