<![CDATA[ Parse error [Solved] - My Forums]]> https://forums.modx.com/thread/?thread=49671 <![CDATA[Re: Parse error [Solved]]]> https://forums.modx.com/thread/49671/parse-error-solved?page=3#dis-post-544722 Had the same one after migrating a website.

Old site (MaxiGallery working well):
Hosting: Yellis.net
PHP 5.3.29
MySQL 5.5.47
MODx 1.0.3
magic_quotes_gpc Off
magic_quote_runtime Off

New site:
Hosting: Infomaniak.website (URL for site preview)
PHP 5.6.22
MySQL 5.0.11-dev
MODX 1.1
magic_quotes_gpc ?(status not mentioned by phpinfo.php)
magic_quote_runtime ?(status not mentioned by phpinfo.php)


By echoing $mg->pics_tbl, I observed that the table name doesn't have back quotes around it.

When trying $query=mysql_query("$modx->db->query"); as SimonMW did, this error was returned
"Error : Object of class DBAPI could not be converted to string"

I verified the table in phpMyAdmin and it had no defect.

Solved the issue by simply commenting out the whole "validate table" block in maxigallery.php:
//validate gallery table
/*
$query=mysql_query("DESC $mg->pics_tbl");

if(!$query) {
  ...
} else {
  ...
}
*/

Works. But of course, a patch would be appreciated.

Maybe does the error come from MySQL as I see Infomaniak is using an older "dev" MySQL client for preview URLs, or some server settings.]]>
Jul Sep 03, 2016, 05:42 PM https://forums.modx.com/thread/49671/parse-error-solved?page=3#dis-post-544722
<![CDATA[Re: Parse error]]> https://forums.modx.com/thread/49671/parse-error-solved?page=3#dis-post-291178 sottwell Jan 29, 2008, 04:37 PM https://forums.modx.com/thread/49671/parse-error-solved?page=3#dis-post-291178 <![CDATA[Re: Parse error]]> https://forums.modx.com/thread/49671/parse-error-solved?page=3#dis-post-291177 doze Jan 29, 2008, 03:39 PM https://forums.modx.com/thread/49671/parse-error-solved?page=3#dis-post-291177 <![CDATA[Re: Parse error]]> https://forums.modx.com/thread/49671/parse-error-solved?page=3#dis-post-291176 ]]> SimonMW Jan 29, 2008, 03:27 PM https://forums.modx.com/thread/49671/parse-error-solved?page=3#dis-post-291176 <![CDATA[Re: Parse error]]> https://forums.modx.com/thread/49671/parse-error-solved?page=3#dis-post-291175 sottwell Jan 29, 2008, 03:25 PM https://forums.modx.com/thread/49671/parse-error-solved?page=3#dis-post-291175 <![CDATA[Re: Parse error]]> https://forums.modx.com/thread/49671/parse-error-solved?page=3#dis-post-291174
I entered the line incorrectly, just corrected it to replace the mysql_query bit and presto, the page now works! smiley

So, will this code be okay leaving it as it is, or would this be only a temp fix?

Many thanks for all the trouble you have taken over this! :-D]]>
SimonMW Jan 29, 2008, 03:22 PM https://forums.modx.com/thread/49671/parse-error-solved?page=3#dis-post-291174
<![CDATA[Re: Parse error]]> https://forums.modx.com/thread/49671/parse-error-solved?page=3#dis-post-291173
$query=mysql_query("$modx->db->query"); 


The result was;

« MODx Parse Error »

MODx encountered the following error while attempting to parse the requested resource:
« PHP Parse Error »

PHP error debug
Error: Object of class DBAPI could not be converted to string
Error type/ Nr.: - 4096
File: /home/fiveep/public_html/assets/snippets/maxigallery/maxigallery.php
Line: 241
Line 241 source: $query=mysql_query("$modx->db->query");

Parser timing
MySQL: 0.0052 s (5 Requests)
PHP: 0.2392 s
Total: 0.2444 s
Error while inserting event log into database.
]]>
SimonMW Jan 29, 2008, 03:19 PM https://forums.modx.com/thread/49671/parse-error-solved?page=3#dis-post-291173
<![CDATA[Re: Parse error]]> https://forums.modx.com/thread/49671/parse-error-solved?page=2#dis-post-291172 sottwell Jan 29, 2008, 03:16 PM https://forums.modx.com/thread/49671/parse-error-solved?page=2#dis-post-291172 <![CDATA[Re: Parse error]]> https://forums.modx.com/thread/49671/parse-error-solved?page=2#dis-post-291171 sottwell Jan 29, 2008, 03:13 PM https://forums.modx.com/thread/49671/parse-error-solved?page=2#dis-post-291171 <![CDATA[Re: Parse error]]> https://forums.modx.com/thread/49671/parse-error-solved?page=2#dis-post-291170 SimonMW Jan 29, 2008, 03:12 PM https://forums.modx.com/thread/49671/parse-error-solved?page=2#dis-post-291170