Re: Is this the best way?

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

 




On Mar 18, 2008, at 12:26 PM, TG wrote:


Somehow it is getting to this statement and the variable that you
are using just before the ORDER BY part is empty,  Why don't you
show us that statement.

Requested statement below:

$query = "SELECT * from ".$linkauth['table']." order by ".$sortOrder;

The $linkauth['table'] is returned when the authentication is
successful. Otherwise it's not written so that you have to log in to
see the contents of the database.


Sorry, havn't had a ton of time to go over mailing list messages recently. If I recall, you said that the big issue was that this query shouldn't run if the user isn't logged in. So that would point to an issue with your logic before you get to this point. You might see where you're checking for the user being logged in or not and make sure everything is within the
proper "if" grouping.


This specific query and the reason you're getting that MySQL error is
probably because when a user isn't logged in, your $linkauth['table']
variable is empty.  So what you're getting for a SQL statement is:

SELECT * from  order by <$sortOrder if it's populated>

I think you're spot on here... Time to revisit my authentication function and see if I can streamline it :)



--

Jason Pruim
Raoset Inc.
Technology Manager
MQC Specialist
3251 132nd ave
Holland, MI, 49424-9337
www.raoset.com
japruim@xxxxxxxxxx




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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux