Re: Is this the best way?

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

 



Then it's the other query (with the ORDER BY) that you want to look at to fix 
the SQL error.

Don't forget to use (assuming MySQL) mysql_real_escape_string() on all 
variables being used in the SQL query.  That'll help prevent a problem with 
single quotes or other bad characters showing up in your variables and 
breaking your SQL.  Not to mention the security benefits.

-TG

----- Original Message -----
From: Jason Pruim <japruim@xxxxxxxxxx>
To: "TG" <tg-php@xxxxxxxxxxxxxxxxxxxxxx>
Cc: "PHP General List" <php-general@xxxxxxxxxxxxx>
Date: Fri, 14 Mar 2008 17:11:40 -0400

> > Ok so the next thing to check is your query.  Maybe echo it out so  
> > you can
> > see what's actually attempting to execute.
> 
> echo from my actual query
> SELECT * FROM current WHERE loginName='japruim' AND  
> loginPassword='mybadpassword' LIMIT 0,1;
> >
> >
> > I don't see an "ORDER BY" in the SQL listed below.
> 
> The ORDER BY actually comes from a different query that should ONLY be  
> done AFTER successful login... It's actually related to the sorting of  
> the records that should be retrieved.


-- 
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