Author Topic: Bad SQL Query problem  (Read 12610 times)

0 Members and 1 Guest are viewing this topic.

Offline X-Fan

  • Full Member
  • ***
  • Posts: 117
    • View Profile
    • http://www.comixfan.com/xfan/
Bad SQL Query problem
« on: July 05, 2002, 01:00:28 PM »
Hi there,

Just updated to v1.6, but now on my 4images Admin Control Panel home page, in the last column of the Users row in the Stats table I'm getting:

Quote

DB Error: Bad SQL Query: SHOW TABLE STATUS FROM x-mencomics_com
You have an error in your SQL syntax near '-mencomics_com' at line 1
n/a


Can anyone help me fix this, please?
Eric J. Moreels
ComiX-Fan Editor-in-Chief
e-mail: webmaster@comixfan.cjb.net
Web: http://www.comixfan.com/xfan
AIM: XFan2k

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Bad SQL Query problem
« Reply #1 on: July 05, 2002, 01:17:01 PM »
strange i just created a DB with the name x-mencomics_com

with cmd SHOW TABLE STATUS FROM x-mencomics_com
in ssh/telnet and phpmyadmin

ssh/telnet:
Code: [Select]

mysql> SHOW TABLE STATUS FROM x-mencomics_com;
ERROR 1064: You have an error in your SQL syntax near '-mencomics_com' at line 1
mysql>


phpmyadmin:
Code: [Select]

Error

SQL-query :  

SHOW TABLE STATUS FROM x-mencomics_com

MySQL said:


You have an error in your SQL syntax near '-mencomics_com' at line 1

the x is missing...


with DB Nicky_2
"SHOW TABLE STATUS FROM Nicky_2"
i get some statistics from this DB

with Nicky-77 same error
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline X-Fan

  • Full Member
  • ***
  • Posts: 117
    • View Profile
    • http://www.comixfan.com/xfan/
Bad SQL Query problem
« Reply #2 on: July 05, 2002, 01:29:41 PM »
It's only been doing that since I upgraded to v1.6 about half an hour ago.

Everything seems to be working fine; I can upload new images to my gallery and browse fine.  I'm just getting that weird error.
Eric J. Moreels
ComiX-Fan Editor-in-Chief
e-mail: webmaster@comixfan.cjb.net
Web: http://www.comixfan.com/xfan
AIM: XFan2k

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Bad SQL Query problem
« Reply #3 on: July 05, 2002, 01:44:52 PM »
hi,

this have nothing todo with 4images because with my DB name "Nicky_2" i don't have this error..
using 4images 1.6 & mysql 3.23.49a

if i use DB "x-memorics_com" i get everyware the SQL error
in 4images, ssh, phpMyAdmin..

can u use x_memorics_com instead of x-memorics_com ?

note underline after x
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline X-Fan

  • Full Member
  • ***
  • Posts: 117
    • View Profile
    • http://www.comixfan.com/xfan/
Bad SQL Query problem
« Reply #4 on: July 05, 2002, 02:11:07 PM »
I have had my site online since February with the SQL database name of x-mencomics_com and it has been working absolutely fine.  So it cannot be my database name that is the problem.

This is the first time I've had such an error where any PHP application has had a problem with the DB name.

My host is running MySQL v3.23.36 and PHP v4.0.6 (in Safe Mode).

It's more an annoyance than anything else, as it does not seem to be affecting the functionality of 4images.  Still, I would like to see the error fixed.
Eric J. Moreels
ComiX-Fan Editor-in-Chief
e-mail: webmaster@comixfan.cjb.net
Web: http://www.comixfan.com/xfan
AIM: XFan2k

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Bad SQL Query problem
« Reply #5 on: July 05, 2002, 04:23:13 PM »
hi,

here a solution:
open includes/db_utils.php

find
Code: [Select]

  if (get_mysql_version() >= 32303) {

ADD AFTER
Code: [Select]

  $db_name = (get_mysql_version() >= 32306)  ? "`$db_name`" : $db_name;


more about: http://www.mysql.com/doc/L/e/Legal_names.html

@ thx to Jan
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline X-Fan

  • Full Member
  • ***
  • Posts: 117
    • View Profile
    • http://www.comixfan.com/xfan/
Bad SQL Query problem
« Reply #6 on: July 05, 2002, 04:59:00 PM »
That worked perfectly, thanks very much!  :D
Eric J. Moreels
ComiX-Fan Editor-in-Chief
e-mail: webmaster@comixfan.cjb.net
Web: http://www.comixfan.com/xfan
AIM: XFan2k

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
Bad SQL Query problem
« Reply #7 on: July 05, 2002, 11:08:14 PM »
[offtopic]
click here
http://www.x-mencomics.com/xfan/

than click on your VB "home" button then click it again...

there is a "bug" with left frame ;)
[/offtopic]
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline X-Fan

  • Full Member
  • ***
  • Posts: 117
    • View Profile
    • http://www.comixfan.com/xfan/
Bad SQL Query problem
« Reply #8 on: July 06, 2002, 05:26:53 AM »
Ah, thanks for that!  :oops:
Eric J. Moreels
ComiX-Fan Editor-in-Chief
e-mail: webmaster@comixfan.cjb.net
Web: http://www.comixfan.com/xfan
AIM: XFan2k