Re: Is this the best way?
| From: | Jason Pruim | Date: | Tue, 18 Mar 2008 19:47:44 +0000 |
| Subject: | Re: Is this the best way? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-271743@lists.php.net to get a copy of this message | ||
On Mar 18, 2008, at 12:26 PM, TG wrote:
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@raoset.comSorry, 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>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.