I just tried it, but all I got was a totally blank page.
-
☆ A M B ☆
- 24,524 Posts
Very interesting. Just to make sure this is working as expected, change that echo to "echo ’Hello’; exit();" and see if you get Hello to the screen.
Quote from: SimonMW at Jan 29, 2008, 02:08 PM
Can I just check if this is the full line you meant?
$query=mysql_query("DESC $mg->pics_tbl") echo $query; exit();
As you can probably gather I don’t know much about PHP 
Just to be sure..
You did put that "echo $query; exit();" line in the maxigallery snippet code (to maxigallery.php file) below that $query=mysql_query("DESC $mg->pics_tbl") line? right? and there is an semicolon after the maxigallery mysql_query line?
Eg.
//validate gallery table
$query=mysql_query("DESC $mg->pics_tbl");
echo $query;
exit();
if(!$query) {...
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
Yep. Just tried that and it displayed the Hello message.
Just realised that this is on a new page. I deleted the old gallery that didn’t work and tried to create a new one to see if I would still get an error. It threw up the SQL error again, and because of that I couldn’t add any pictures to the new gallery. Could this be why it is blank?
-
☆ A M B ☆
- 24,524 Posts
We will presume that there is an sql error. Replace that echo line with this one and see what it says.
echo mysql_error(); exit();
-
☆ A M B ☆
- 24,524 Posts
There you go. The mysql user you are using does not have permission to query the database. Or that table, at any rate.
Yeah. The trouble is, I don’t know how it got set like that, or how to change it back. Hmmmmm, very odd!
-
☆ A M B ☆
- 24,524 Posts
Try something. Get rid of the echo and exit stuff. Change the mysql_query to $modx->db->query (just that, leave the rest of the line as it is)
-
☆ A M B ☆
- 24,524 Posts
We know that the MODx database connection is good, or else your pages wouldn’t work at all. So perhaps your forum is opening its own database connection that’s hanging around, and since this is using the generic "mysql_query" it’s sort of inheriting that leftover connection. My hope is that using the modx database API like this will cause it to use the MODx connection instead.