confusing error in straightforward INSERT statement

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
calebsg
Forum Commoner
Posts: 28
Joined: Tue Jun 18, 2002 10:41 am

confusing error in straightforward INSERT statement

Post by calebsg »

The following MySQL command almost works:
їcode]INSERT INTO employee_info (co_id,co_em_id,em_first_name,em_last_name,em_start_date,em_pos,em_start_date_co,em_addr_1,em_addr_2,em_city,em_prov_id,em_pc,em_fax,em_phone,em_dob,em_email,em_sex,em_status_co,em_pcc,em_fcc,em_ei,em_status_sys) VALUES ('4','2943','Caleb','Alpen',CURDATE(),'Trucker','2001-9-18','Addrss line 1','address ln 2','city','1','S0C 0S0','3063825340','3264425340','1937-03-13','csg@test.com','M','2','123','123','1.3','1')ї/code]

For some weird reason the em_fax field always shows up in the database as 2147483647 instead of the number it's supposed to put in! em_fax is set up exactly the same as em_phone and em_phone inserts just fine. There are no associated error messages, and this statement is PHP generated by a form -- I just echoed it to the browser so I could cut and paste it.

Any suggestions?

jason
Site Admin
Posts: 1767
Joined: Thu Apr 18, 2002 3:14 pm
Location: Montreal, CA
Contact:

Post by jason »

How are you verifying what's in the database?
calebsg
Forum Commoner
Posts: 28
Joined: Tue Jun 18, 2002 10:41 am

Post by calebsg »

I just "browse" the table with phpMyAdmin.

I also tried putting the SQL statement into the command box provided by phpMyAdmin and I get the same result.

Both the phone and fax columns are INT(11) NULL. The only thing I can think of is I added em_fax after the rest of the table was built, but I can't see how that would cause the problem. :?
Post Reply