Connecting Tech Pros Worldwide Forums | Help | Site Map

Bad date error

Newbie
 
Join Date: Aug 2008
Posts: 27
#1: Sep 8 '08
HI
Can Anyone help me in correcting the error.I have a datbase in psql which has a date field.While trying to insert it using php form i am getting the error:
Quote:
Warning: pg_query(): Query failed: ERROR: Bad date external representation '' . in
/var/www/html/date.php
But When i try to insert directly from Database it is working.
What may be the problem??Anyone please help.

Thank u in advance.

Moderator
 
Join Date: Dec 2006
Location: Europe
Posts: 293
#2: Sep 8 '08

re: Bad date error


Are you sure the date format you use in postgres and in the script are the same?
Newbie
 
Join Date: Aug 2008
Posts: 27
#3: Sep 9 '08

re: Bad date error


hi some how i managed to correct the date format.Now i have a problem with the phone number field.I have specified while creating the table as phone integer.But when i try to insert a value which has more than 10 digits,it shows error.No validation has done yet.
How can i correct it.
Moderator
 
Join Date: Dec 2006
Location: Europe
Posts: 293
#4: Sep 9 '08

re: Bad date error


Quote:

Originally Posted by sreenisha

hi some how i managed to correct the date format.Now i have a problem with the phone number field.I have specified while creating the table as phone integer.But when i try to insert a value which has more than 10 digits,it shows error.No validation has done yet.
How can i correct it.

change the column type to varchar(max_number_of_characters) or char(max_number_of_characters)
Reply