Is this syntax is correct?
Is this syntax is correct?
am 05.09.2010 15:18:19 von Nagendra Prasad
--0016e68ea4fb872ad5048f830090
Content-Type: text/plain; charset=ISO-8859-1
Hi All,
Is this syntax is correct??
SELECT username FROM data, password FROM registration WHERE username=%s AND
password=%s"
Best,
Guru.
--0016e68ea4fb872ad5048f830090--
Re: [PHP-DB] Is this syntax is correct?
am 05.09.2010 17:35:03 von Niel Archer
> Hi All,
>
> Is this syntax is correct??
>
> SELECT username FROM data, password FROM registration WHERE username=%s AND
> password=%s"
No, it is not.
This list is for Windows based PHP matters. You will find far more
knowledgeable people (so more responses) by asking on the appropriate
list, i.e. php-db@lists.php.net for database related PHP matters, or an
SQL list/forum for SQL problems.
http://dev.mysql.com/doc/refman/5.1/en/select.html
You seem to be trying to do a JOIN
> Best,
> Guru.
--
Niel Archer
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Is this syntax is correct?
am 06.09.2010 16:48:47 von Amit Tandon
--00163628528ce8ef27048f986145
Content-Type: text/plain; charset=UTF-8
SELECT d.username, r.password FROM data join registration r on r.username
= d.username WHERE r.username like '%s' AND
r.password like '%s'"
Presuming the password stored as clear text and username is common field
SELECT d.username, r.password FROM data join registration r on r.username
= d.username WHERE r.username like '%s' AND
r.password like '%s'"
or
SELECT d.username FROM data as d, registration as r WHERE r.username like
'%s' AND
and r.password like '%s'"
and r.username = d.username
============
regds
amit
"The difference between fiction and reality? Fiction has to make sense."
On Sun, Sep 5, 2010 at 6:48 PM, nagendra prasad wrote:
> Hi All,
>
> Is this syntax is correct??
>
> SELECT username FROM data, password FROM registration WHERE username=%s AND
> password=%s"
>
>
> Best,
> Guru.
>
--00163628528ce8ef27048f986145--
Re: Is this syntax is correct?
am 06.09.2010 16:48:47 von Amit Tandon
--00163628528ce8ef27048f986145
Content-Type: text/plain; charset=UTF-8
SELECT d.username, r.password FROM data join registration r on r.username
= d.username WHERE r.username like '%s' AND
r.password like '%s'"
Presuming the password stored as clear text and username is common field
SELECT d.username, r.password FROM data join registration r on r.username
= d.username WHERE r.username like '%s' AND
r.password like '%s'"
or
SELECT d.username FROM data as d, registration as r WHERE r.username like
'%s' AND
and r.password like '%s'"
and r.username = d.username
============
regds
amit
"The difference between fiction and reality? Fiction has to make sense."
On Sun, Sep 5, 2010 at 6:48 PM, nagendra prasad wrote:
> Hi All,
>
> Is this syntax is correct??
>
> SELECT username FROM data, password FROM registration WHERE username=%s AND
> password=%s"
>
>
> Best,
> Guru.
>
--00163628528ce8ef27048f986145--
Re: Is this syntax is correct?
am 06.09.2010 17:11:59 von Swincher
Amit Tandon wrote:
> SELECT d.username, r.password FROM data join registration r on r.username
>> SELECT username FROM data, password FROM registration WHERE username=%s AND
>> password=%s"
Oh, boy -- "r on r"?? Obviously the guy is a rookie.
Let's be simple:
SELECT data.username,registration.password
FROM data inner join registration
ON data. = registration.
WHERE username=%s
AND password=%s"
is the name of the common field in each table, such as
"user_id".
Comments:
1. "data" is a really bad name for a table. You will confuse the heck
out of yourself and others who follow you. Change it.
2. As Amit kind of said, no password should be stored in a table
(available on a web server) without encrypting the password information.
Ken
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Is this syntax is correct?
am 06.09.2010 17:15:38 von Richard Quadling
On 6 September 2010 16:11, Ken Kixmoeller wrote:
> 2. As Amit kind of said, no password should be stored in a table (available
> on a web server) without encrypting the password information.
I'd go further and say "no password should be stored in a table".
A hash of the salted password, sure.
--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
PHP Search DB Table
am 14.12.2010 12:08:33 von Oliver Kennedy
--_1543dc89-93c0-4eae-9882-ea0877b9d1d7_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hello Everyone
=20
Apologies if I have not done this in the correct way=2C this is the first t=
ime I have turned to your for help so I am unaware if I have to submit this=
according to a certain protocol=2C if that is the case then please let me =
know and I will go through the proper channels. My problem is this.
=20
I have a very simple database consisting of 1 table=2C I want users here to=
be able to use a search function to query the database in order to return =
the information on a client by a specific ID number if it is in the databas=
e. My search form is this
=20