header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
rakesh
Points:0
Posts:0

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;
	}







1
Rex
Points: 1180
Posts:0
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.

2
rakesh
Points: 0
Posts:0
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.


Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 7+1 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions