Re: Problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 06 Nov 2003 05:46:03 +0100
Boyan Nedkov <k24d88@xxxxxxx> wrote:

> 
> A bit difficult to debug this without the file included (config.php); 
> providing the error message would also be helpful.
> 
> At first glance, I'm just wondering what does the dot mean in the
> table name used in the FROM clause:
> 
> FROM school.physics_chris_rockets
> 
> It shouldn't generate a php syntacs error message, but I'm afraid that
> 
> query wont work
> 
> 
> boyan
> --
> 
> 
> > 
> > $conn = mysql_connect ( $dbhost , $dbuser , $dbpass );
> > $sql_select = 'SELECT * FROM school.physics_chris_rockets WHERE
> > Period LIKE'.$Period.' AND Visible LIKE "Y" ORDER by Position, Name,
> > Date';
> > $result = mysql_query($sql_select);
> > 

If the that the database name is school with a table name of
physics_chris_rockets then that query might work but we really need the
error that is displayed by php or echo $sql_select and copy and paste
that to the mysql console. If it gives an error there, fix the query
error, if not look somewhere else.


People, Don't not be afraid to display plenty of debug statements. For
example make sure that $Period is being set. chanage the line 
$conn = mysql_connect ( $dbhost , $dbuser , $dbpass );
to 
$conn = mysql_connect ( $dbhost , $dbuser , $dbpass ) or die("Database
error: . mysql_error();

If there is a problem with the database, stop there and print the mysql
error message. When you have that working remove the die statement and
replace with some good error handling.

But really we need the error message...


George Patterson

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux