I am using this query from a PHP script but I am also testing it from
the windows gui.
The mysql server runs on a sun sparc with solaris 10, the mysql version
is 4.1.12
php 5.0.4
one thing i forgot to mention is that it only occurs when i have a where
clause. if i do just a select * from tabel it works fine. The result of
my where clause is a single row, but i want all the columns.
My table definition looks as follows:
CREATE TABLE clients (
clientid tinyint(4) NOT NULL auto_increment,
name varchar(50) NOT NULL,
password varchar(50) NOT NULL,
email varchar(255) NOT NULL,
ref varchar(50) NOT NULL,
title varchar(255) NOT NULL,
PRIMARY KEY (clientid)
);
#
#
#
INSERT INTO clients VALUES( '1', 'admin', '43e9a4ab75570f5b',
'y***@email.com', '', 'admin');
my select statement is as follows:
select * from clients where name = 'admin' and password = PASSWORD('admin')
I am trying to match the password given in the web page to php to the
one store in mysql.
If i change the select to only select a single column it works, put the
* back and it no longer works.
I tried it via the mysql interactive tool on the sun box and it works.
Bill Karwin wrote:
Hendry Taylor wrote:
I have a problem where if I issue a select * from against a database it
returns no data,
but if I select column from it returns the data.
Why would the * not be working as a wildcard?
That's certainly unexpected.
Questions:
- What version of MySQL are you using?
- What environment are you using to execute the query? e.g. mysql
command-line tool, MySQL Query Browser gui application, Java program,
Perl script, C++, Microsoft ODBC client...
- Does this behavior occur in other query environments? Try it in the
mysql command-line tool and see if you get the same strange result.
Regards,
Bill K.