I been staring and editing the codes for hours...I cant seem to understand it at all. I want to login basically. I have a mysql stored procedure in this way:
PHP: db.php
and now the login.php
The error code it returns is Unknown field name $username i.e. if i enter samsam for username it would be Unknown fieldname samsam in the fieldlist.
I have other stored procedures that are similar and work awesome. What am i doing wrong?
Code:
CREATE DEFINER=`dan78`@`localhost` PROCEDURE `spLogMeIn`(IN uname varchar(12), IN upwd varchar(40)) BEGIN SELECT memberid,memstatus,mememail,avatarname FROM tblmembers WHERE memuname=uname AND mempwd=upwd; END
Code:
public function runSelectQuery($sql) { try { $q = $this->conn->prepare($sql); $q->execute(); return $row = $q->fetchAll(); } catch (PDOException $e){ return $e->getCode(); } }
Code:
require(DBFILE); $mydb = new dbACW(); $result = $mydb->runSelectQuery("CALL spLogMeIn($uname,$upwd);");
I have other stored procedures that are similar and work awesome. What am i doing wrong?
Comment