6/29/2010 10:08:30 PM
Title:
Unable to add Date to the Database
Hi Friends,
I am trying to add the date value to mysql using flex-DateChooser controll with PHP code.
But it is adding 0000-00-00 value.
please help me to solve this issue.
public function createAppointments($item) {
$stmt = mysqli_prepare($this->connection, "INSERT INTO $this->tablename (cusId, apptDate, apptTime, statusId, typeId, notes) VALUES (?, ?, ?, ?, ?, ?)");
$this->throwExceptionOnError();
mysqli_stmt_bind_param($stmt, 'issiis', $item->cusId, $item->apptDate->toString('YYYY-MM-dd HH:mm:ss'), $item->apptTime, $item->statusId, $item->typeId, $item->notes);
$this->throwExceptionOnError();
mysqli_stmt_execute($stmt);
$this->throwExceptionOnError();
$autoid = mysqli_stmt_insert_id($stmt);
mysqli_stmt_free_result($stmt);
mysqli_close($this->connection);
return $autoid;
}
6/29/2010 10:49:00 PM
first of all you should trace the value in the php page , to confirm that you are receiving the value from flex. To send value from flex to php you should use http service in flex and submit the data using get or post.
6/30/2010 1:52:00 AM
Hi Rex,
Thanks for yours answer.
I have solved this issue, I was using the DateChooser and trying to convert it into the string.
Now i have used DatePicker and set its formatString to "YYYY-MM-DD"
Now its working fine.
Once again thanks for the help.