#37065 [Opn->Fbk]: error in mysqli
| From: | derick@php.net | Date: | Thu, 13 Apr 2006 11:06:51 +0000 |
| Subject: | #37065 [Opn->Fbk]: error in mysqli | ||
| References: | 1 | Groups: | php.mirrors |
| Request: | Send a blank email to php-mirrors+get-31181@lists.php.net to get a copy of this message | ||
ID: 37065
Updated by: derick@php.net
Reported By: goliraja at yahoo dot com
-Status: Open
+Status: Feedback
Bug Type: Website problem
Operating System: windows 2000
PHP Version: Irrelevant
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2006-04-13 05:23:29] 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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37065&edit=1