php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37065 error in mysqli
Submitted: 2006-04-13 05:23 UTC Modified: 2006-04-21 01:00 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: goliraja at yahoo dot com Assigned:
Status: No Feedback Package: Website problem
PHP Version: Irrelevant OS: windows 2000
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-04-13 05:23 UTC] goliraja at yahoo dot com
Description:
------------
Fatal error: Call to a member function bind_param() on a non-object in C:\wamp\www\deftmd\classes\DAL\AppointDAO.php on line 151

iam getting almost all file this erroe 

Reproduce code:
---------------
public function insert(&$conn, Appoint &$appt) {
       
  	
   $start_time = strtotime($appt->appt_start_ts);

   Debug::createInstance()->println("Inside AppointDAO Insert " . $appt->starthour );

   $start_time = $start_time + $appt->starthour * 60 * 60;
   $end_time = $start_time + $appt->duration * 60;
   $appt->appt_start_ts = date('Y-m-d H:i:s', $start_time);
   $appt->appt_end_ts = date('Y-m-d H:i:s', $end_time);

   Debug::createInstance()->println("Inside AppointDAO Insert ". $appt->appt_start_ts);
   Debug::createInstance()->println("Inside AppointDAO Insert ". $appt->appt_end_ts);

   

   try {

        Debug::createInstance()->println("Inside AppointDAO Insert Provider ");

        Debug::createInstance()->println("Inside AppointDAO Insert Provider ". $appt->duration);

        Debug::createInstance()->println("Inside AppointDAO Insert Provider ". $appt->provider->id);        

	   $InsertSQL = "INSERT INTO APPOINTMENTS(APPT_TYPE, EVENT, EVENT_DESC, APPT_START_TS, DURATION, APPT_END_TS, PROVIDER_ID, LOCATION_ID) VALUES(?,?,?,?,?,?,?,?)";

        $stmt = $conn->prepare($InsertSQL);

        $stmt->bind_param("ssssisii", 
                             $appt->appt_type,
			     $appt->event,
			     $appt->event_desc,
			     $appt->appt_start_ts,
			     $appt->duration, 
			     $appt->appt_end_ts,
			     $appt->provider->id,
                             $appt->location_id
                         );
      
        $stmt->execute();
        $appt->id = $stmt->insert_id;

        Debug::createInstance()->println("Inside AppointDAO Generated ID ". $appt->id);        
        
        if ($appt->patient->id != null) {
        $UpdateSQL = "UPDATE APPOINTMENTS SET PATIENT_ID=? WHERE ID=? ";
        $stmt = $conn->prepare($UpdateSQL);
        Debug::createInstance()->println("Inside AppointDAO Update ");        
        $stmt->bind_param("ii", $appt->patient->id, $appt->id);
        $stmt->execute();
        Debug::createInstance()->println("Inside AppointDAO Update Executed ");        
        }
    
    
    
    $stmt->close();
   }
    catch(Exception $e) {
   $stmt->close();
   throw new SQLException("Unable to insert record into Appointments Table");
   
   } 

  }

Expected result:
----------------
create a record 


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-13 11:06 UTC] derick@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.
 [2006-04-21 01:00 UTC] php-mirrors at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 04 16:01:31 2024 UTC