Jump to content

programming2music

New Members
  • Posts

    5
  • Joined

  • Last visited

programming2music's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I think your problem is you're using single quotes in your query and not escaping them.
  2. I posted the whole code because in the class he breaks parts up into separate methods. http://pastebin.com/vF6eiK9Y There isn't a problem with the insert in this class as I use it to create new accounts, I think the problem might be somewhere either in the validation or the user class, I heard something about freeing results but i'm not sure how to go about that. Thanks for the help
  3. Thanks for the reply. I am new to PHP and followed a tutorial on building a class using MySQLi and was echoing the query from this method. protected function _prepareQuery() { echo $this->_query; if (!$stmt = $this->_mysql->prepare($this->_query)) { var_dump($this->_mysql->error); } return $stmt; } I am executing one statement at a time, just looks like 3 in one line from how i was echoing.
  4. I'm not familiar with Wordpress but where ever you're getting your price from I would do something like if ($price > 0) { // code to show button here }
  5. I am trying to make a login which works perfectly until I try and add remember me functionality into the User class. if ( $user ) { // check login password agaisnt the hash if (Hash::verify($password, $this->data()['password'])) { Session::put($this->_sessionName, $this->data()['id']); if ($remember) { $this->mysqli->insert('user_session', array( 'user_id' => $this->data()['id'], 'hash' => uniqid(), )); } } return true; } return false; I am getting the error. mysqli_stmt::bind_param(): Number of elements in type definition string doesn't match number of bind variables But when I echo out the query out I have the correct number of elements. SELECT * FROM users WHERE id= ?SELECT * FROM users WHERE id= ?INSERT INTO user_session ( `user_id`, `hash`) VALUES (?, ?) Does anyone have any idea? I think someone the other queries are affecting it somehow but i'm not sure how.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.