Jump to content

Prepared statement problem

- - - - -

  • Please log in to reply
1 reply to this topic

#1
Rohan21

Rohan21

    Newbie

  • Members
  • Pip
  • 1 posts
Well, i have a problem in prepared statement with 'bind_param'

My queries looks like this

<?php

$result = $db_connection->prepare("update users set date = ? where email= ?");

    $result->bind_param("ss", $mysqlDateString,$email));

    $result->execute();


?>
Here $mysqlDateString is the date variable
When i execute this, it gives error

Quote

Fatal error: Call to a member function bind_param() on a non-object in F:\xampp\htdocs\Login.php on line 21
Here what should be the variable type of date. I have tried many things but nothing works.

#2
Orjan

Orjan

    Writes binary right handed and hex left handed

  • Moderators
  • 3,299 posts
  • Location:Karlstad, Sweden
  • Programming Language:C, Java, C++, C#, PHP, JavaScript, Pascal
  • Learning:Java, C#
it says that bind_param fails as $result is a non-object, that means that your prepare statement failed and returned null.
__________________________________________
I study Information Systems at Karlstad University when I'm not on CodeCall




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users