Is my SELECT query wrong?

yabbadabba

New Member
Hei , I'm trying to verify if my username and password from my xml file is the same with those from my database, but mysql_num_rows is zero. So something must be wrong with my SELECT query.This is my code:\[code\] public function verifyDB(){ //connection to database mysql_connect('localhost','root','') or die(mysql_error()); mysql_select_db('proiect_is') or die(mysql_error()); $data =http://stackoverflow.com/questions/10556218/mysql_query("SELECT id FROM users WHERE userName ='$this->xml->parameters->username' AND password ='$this->xml->parameters->pass'"); //we check if any row was returned echo $data; echo $this->xml->parameters->username."<BR>"; echo $this->xml->parameters->pass."<BR>"; print_r(mysql_num_rows($data)); if (mysql_num_rows($data)) { $row = mysql_fetch_assoc($data); $this->_id= $row['id']; echo $row; return true; } else {return false;}} \[/code\]This is my xml login file:\[code\] <xml version=""> <action>log_in</action> <parameters> <username>Ionel P</username><pass>abdef01</pass> </parameters> </xml>\[/code\]
 
Back
Top