0

Hi
I have the following prepared statement for an UPDATE query:

However I'm getting the following error message:

Fatal error: Call to a member function bind_param() on a non-object in /home/dreamsin/public_html/DEV/edit_condo_review.php on line 467

All my columns are correct and match up and exist and I've used this prepared statement in other pages. So I'm getting very confused.
If anyone can spot anything else to check that would be great....

// Connect to the database
     require_once ('myaccess/dbc.php');

     if (empty($condo_image_name)) { $condo_image_name = $old_condo_image; }

     // $stmnt1 = $dbc->stmt_init();

      $stmnt1 = $dbc -> prepare("UPDATE condo_reviews SET condo_id=?, condo_nm=?,condo_area=?,condo_pri=?,condo_sec=?,condo_mrt=?, condo_rd=?,                    condo_date=?,condo_unit=?,condo_desc=?,screenpath=?, condo_image_name=?,condo_pool=?,condo_tennis=?,                  condo_squash=?,condo_court=?,condo_tt=?,condo_aero=?,condo_golf=?,condo_gym=?,condo_sauna=?,condo_steam=?,condo_funct=?,condo_cafe=?,condo_bbq=?,condo_shop=?,condo_bank=?,condo_kindy=?,condo_play=?,condo_park=? WHERE condo_id=?") ;


        $stmnt1->bind_param('issssssiisssssssssssssssssssssi',$condo_id, $condo_nm, $condo_area, $condo_pri, $condo_sec, $condo_mrt, $condo_rd, $condo_date, $condo_unit, $condo_desc, $screenpath, $condo_image_name, $condo_pool, $condo_tennis, $condo_squash, $condo_court, $condo_tt, $condo_aero, $condo_golf, $condo_gym, $condo_sauna, $condo_steam, $condo_funct, $condo_cafe, $condo_bbq, $condo_shop, $condo_bank, $condo_kindy, $condo_play, $condo_park, $condo_id);

        $stmnt1->execute(); 
        $stmnt1->close();
2
Contributors
2
Replies
5
Views
5 Years
Discussion Span
Last Post by ebanbury
0

Call to a member function bind_param() on a non-object

This would mean that $dbc is not intialized correctly. Is the path of the include correct?

Another possibility is that perhaps you are trying to overwrite condo_id. If this is an auto_increment column, then this is not allowed.

0

Hi
Many apologies for not replying to you sooner.
I will check the $dbc. condo id is an auto-incremented column. However all my other updates throughout the site have also included auto-incremented columns. I'll take it out and give it a try. Thanks again

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.