Pages: [1]
Author Topic: ProArcadeScript DB ERROR! Query failed.  (Read 1317 times)
Customers
Full Member
*

Karma: 1
Posts: 31


on: Aug 30, 08, 02:05 PM

Hi there,

I just installed the new version of PAS(v1.3) and I am getting a database error when I try to submit a game.

ProArcadeScript DB ERROR!
Query failed.
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 1' at line 1 - 1064.
QUERY: SELECT id, title, latin_title FROM categories WHERE id= LIMIT 1


Do you know how I can fix this error?

I didn't install the complete game pack, because I like to check every game to find out if it is cool enough to add to my website.

Thanks in advance!

Kind regards,
Logged
Customers
Full Member
*

Karma: 1
Posts: 31


Reply #1 on: Aug 30, 08, 03:02 PM

Fixed it I think. The game was inactive but did show up on my homepage. When I put the game on active I worked.

Update: The strange thing is. When I put a game inactive it is still showing up in my "People who play *** also like:" and "Hot Games".
« Last Edit: Aug 30, 08, 04:33 PM by Poindexter » Logged
Administrator
Sr. Member
*

Karma: 7
Posts: 486


Email
Reply #2 on: Aug 30, 08, 11:29 PM

Yes, the last thing you mentioned should be fixed. You can do that by replacing few lines in the blocks' php code (admin CP->page blocks->"edit code" button) as following (for version 1.3.1 only!):

MOSTPLAYED:
line 18 must be
Code:
$query = "SELECT id, category_id, title, latin_title, plays_total, active FROM " . $cMain["dbPrefix"] . "games WHERE active=1 AND category_id=". $nCategory ." ORDER BY plays_total DESC LIMIT " . $cB["MOSTPLAYED"]["max"];
line 20:
Code:
$query = "SELECT id, title, latin_title, plays_total, active FROM " . $cMain["dbPrefix"] . "games WHERE active=1 ORDER BY plays_total DESC LIMIT " . $cB["MOSTPLAYED"]["max"];

RELATED:
replace the query (which is right under the "// Now find the "related" games" comment line) to the following:
Code:
$query = 'SELECT g.*, r.*, COUNT(*) AS cnt FROM ' . $cMain['dbPrefix'] . 'games AS g, ' . $cMain['dbPrefix'] .
'related AS r WHERE r.ip IN (SELECT DISTINCT ip FROM ' . $cMain['dbPrefix'] . 'related WHERE g.active=1 AND game_id=' . $gameID .
') AND g.id=r.game_id AND g.id<>' . $gameID . ' GROUP BY r.game_id ORDER BY cnt DESC LIMIT ' . $cB["RELATED"]["max"];

That's it.
Logged
Customers
Full Member
*

Karma: 1
Posts: 31


Reply #3 on: Sep 01, 08, 12:51 PM

Hi Sergey,

Thanks for the quick reply. It seems to work.

There are still some other blocks left which show inactive games. Is this fixed when I download a new version of the script? This way I can download a new version and replace the old block files with the new one.

Thanks in advance.
Logged
Customers
Full Member
*

Karma: 1
Posts: 31


Reply #4 on: Sep 07, 08, 07:41 AM

Hi Sergey,

The  Todays Hot Games block and Added Recently still show inactive games when I replace this files with the new one? Do you have a fix for this? Thanks!
Logged
Administrator
Sr. Member
*

Karma: 7
Posts: 486


Email
Reply #5 on: Sep 07, 08, 08:52 AM

Sure, here are the changes for those 2 blocks:
Today's hot games, line 18  (the first query) must be:
Code:
$query = "SELECT id, category_id, title, latin_title, plays_today, active FROM " . $cMain["dbPrefix"] . "games WHERE active=1 AND category_id=". $nCategory ." ORDER BY plays_today DESC LIMIT " . $cB["MOSTPLAYEDTODAY"]["max"];
Code for line 20 (second query) is:
Code:
$query = "SELECT id, title, latin_title, plays_today, active FROM " . $cMain["dbPrefix"] . "games WHERE active=1  ORDER BY plays_today DESC LIMIT " . $cB["MOSTPLAYEDTODAY"]["max"];

Added Recently, line 17:
Code:
$query = 'SELECT * FROM ' . $cMain['dbPrefix'] . 'games WHERE active=1 AND category_id='. $nCategory . ' ORDER BY ' . $cSort[$cBlock['sort']] . ' LIMIT ' . $cBlock['max'];
line 19:
Code:
$query = 'SELECT * FROM ' . $cMain['dbPrefix'] . 'games WHERE active=1 ORDER BY ' . $cSort[$cBlock['sort']] . ' LIMIT ' . $cBlock['max'];
Logged
Customers
Full Member
*

Karma: 1
Posts: 31


Reply #6 on: Sep 08, 08, 01:34 PM

Hi Sergey,

Thanks! Works perfect.

Best regards,
Logged
Pages: [1]
 
Jump to: