Page 1 of 1

query problem

Posted: Fri Aug 18, 2006 12:00 pm
by eektech909
I built the php page on my personal server and it runs fine.

I then added it to the website server that has php and mysql installed.

database name: sbaker
table name: shows

when i run

Code: Select all

$display = mysql_query("SELECT * FROM SHOWS WHERE DATE >=  '$todays_date' ORDER BY Date");

if (!$display) {
echo mysql_error();
exit();
}
it seems to add the database name to the table name so the mysql_error is

TABLE 'sbaker.SHOWS' doesn't exist.

help?

Posted: Fri Aug 18, 2006 12:09 pm
by feyd
what does "SHOW TABLES" return?

Posted: Fri Aug 18, 2006 12:31 pm
by eektech909
it returns

Resource id #2

Posted: Fri Aug 18, 2006 12:50 pm
by feyd
Running a standard fetch loop over it should yield data. That's what I'm after.

Posted: Fri Aug 18, 2006 12:56 pm
by eektech909
it needs to get the info from the table "shows" but is trying to get it from "sbaker.shows" instead, and its not programmed to try to get info from sbaker.shows.

Posted: Fri Aug 18, 2006 12:59 pm
by s.dot
sbaker is the name of your database, shows is the name of your table. therefore sbaker.shows would be your table. So, that is correct.

I noticed you used all caps in your query. Are you sure the table isn't named "shows" instead of "SHOWS". Caps do matter.