Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Prepared statement problem

bind_param variable type prepared statement

  • Please log in to reply
1 reply to this topic

#1 Rohan21

Rohan21

    CC Lurker

  • Just Joined
  • Pip
  • 1 posts

Posted 02 January 2012 - 03:39 AM

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

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.
  • 0

#2 Orjan

Orjan

    CC Mentor

  • Moderator
  • 2918 posts
  • Location:Karlstad, Sweden
  • Programming Language:C, Java, C++, C#, PHP, JavaScript, Pascal
  • Learning:Java, C#

Posted 02 January 2012 - 07:38 AM

it says that bind_param fails as $result is a non-object, that means that your prepare statement failed and returned null.
  • 0

I'm a System developer at XLENT Consultant Group mainly working with SugarCRM.
Please DO NOT send mail or PM to me with programming questions, post them in the appropriate forum instead, where I and others can answer you.






Also tagged with one or more of these keywords: bind_param, variable type, prepared statement

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download