PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > Re: [PHP] Is this the best way?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Re: [PHP] Is this the best way?

Réponse
 
LinkBack Outils de la discussion
Vieux 14/03/2008, 22h40   #1
TG
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Is this the best way?


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 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@raoset.com>
To: "TG" <tg-php@gryffyndevelopment.com>
Cc: "PHP General List" <php-general@lists.php.net>
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.


  Réponse avec citation
Vieux 14/03/2008, 22h42   #2
Jason Pruim
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Is this the best way?


On Mar 14, 2008, at 5:40 PM, TG wrote:

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


All that's taken care of... The issue is though, that that query is
getting run even when the login wasn't successful... When you log in
with the proper username/password that query runs just fine...

>
>
> -TG
>
> ----- Original Message -----
> From: Jason Pruim <japruim@raoset.com>
> To: "TG" <tg-php@gryffyndevelopment.com>
> Cc: "PHP General List" <php-general@lists.php.net>
> 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.

>
>


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 11h45.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09953 seconds with 10 queries