RE: [PHP-DB] MySQL Password Writes but Doesn't Read!@#%^
| From: | Novotný Petr | Date: | Thu, 03 Jan 2002 11:38:23 +0000 |
| Subject: | RE: [PHP-DB] MySQL Password Writes but Doesn't Read!@#%^ | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-15325@lists.php.net to get a copy of this message | ||
Hello,
Clear - coding has 16 characters - you have defined usrpassword in the
second DB for 15 - probably one character is missing with coding.
I am rather sure it is the problem, if not - sorry to disturb you....
Regards,
Petr.
-----Original Message-----
From: Matthew Tedder [mailto:matthew@tedder.com]
Sent: Thursday, January 03, 2002 8:43 AM
To: PHP Mailing List
Subject: [PHP-DB] MySQL Password Writes but Doesn't Read!@#%^
Can someone please explain this to me?! It's a real puzzle..
Using the "password('abc')" command in a MySQL insert statement works for me
but using it again in a select statement does not. Well--it does in one
MySQL database I have but doesn't in another one. I've done exactly the
same
thing in each...
This one works (the next one does not):
=================================================
mysql> use medburg
Database changed
mysql> explain Users;
+----------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------+----------+------+-----+---------+-------+
| username | char(16) | | PRI | | |
| password | char(16) | YES | | NULL | |
+----------+----------+------+-----+---------+-------+
2 rows in set (0.00 sec)
mysql> insert into Users (username,password) values
mysql> ('joe',password('joe1'));
Query OK, 1 row affected (0.04 sec)
mysql> select * from Users where password = password('joe1');
+----------+------------------+
| username | password |
+----------+------------------+
| joe | 2ca5307d5156d8ce |
+----------+------------------+
1 row in set (0.00 sec)
mysql>
This example does NOT appear to Work:
=================================================
mysql> use OpenSIG
Reading table information for completion of table and column names You can
turn off this feature to get a quicker startup with -A
Database changed
mysql> explain Users;
+-------------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+----------+------+-----+---------+-------+
| usrlogin | char(15) | | PRI | | |
| usrpassword | char(15) | | | | |
| usrsurname | char(15) | YES | | NULL | |
| usrforname | char(15) | YES | | NULL | |
| usremail | char(64) | YES | | NULL | |
+-------------+----------+------+-----+---------+-------+
5 rows in set (0.00 sec)
mysql> insert into Users (usrlogin,usrpassword) values
('joe',password('joe1'));Query OK, 1 row affected (0.00 sec)
mysql> select * from Users where usrpassword = password('joe1');
Empty set (0.00 sec)
mysql>
So what on earth went wrong?? What was the difference besides field names?
I am totally lost here... Help...
--Matthew
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net