Very Strange...

PHP coding talk.

Moderator: Moderators

Very Strange...

Postby UseLess on Thu May 12, 2005 1:25 pm

Greetings,

I came across something really very strange, while tinkering with the contacts form I entered this;

Code: Select all
   $sql = "SELECT user_id, username, user_email, user_level
      FROM " . PHPBB_USERS . "
      WHERE user_level > 0
      ORDER BY user_level";


Which worked fine on my local dev server, however when I uploaded the file to my forum it complained with;

Code: Select all
SQL Error : 1146 Table 'PHPBB_USERS' doesn't exist


At which point I changed it to;

Code: Select all
   $sql = "SELECT user_id, username, user_email, user_level
      FROM " . USERS_TABLE . "
      WHERE user_level > 0
      ORDER BY user_level";


And it then worked as expected, however, I just don't get why it works locally after all 'PHPBB_USERS' is or shouldn't be defined... and no I don't know why I put 'PHPBB_USERS' instead of 'USERS_TABLE'...
Movie Quote:
It's not the years honey, it's the mileage...

I do not provide any install services for phpBB, Mods or Styles.
Please do not pm me for support/scripting help - you won't get any reply. If you have a question then make a post in the appropriate forum.
User avatar
UseLess
Registered User
Registered User
 
Posts: 6220
Joined: Mon Sep 27, 2004 2:14 am
Location: North East, UK

Postby PostBot on Thu May 12, 2005 1:28 pm

It works on your local server because tables names on mysql on windows are case insensitive.
Do NOT pm me, I don't visit this forum anymore, don't own it, don't provide any support and don't moderate.
User avatar
PostBot
Moderator
Moderator
 
Posts: 10659
Joined: Sat Aug 02, 2003 3:52 pm
Location: Mars


Return to PHP Programming

Who is online

Users browsing this forum: No registered users and 1 guest