I recently decided to create a quick and dirty php form to insert data into a mySQL data base. It seems simple enough of course (and I’ve done it hundreds of times). As with all programming issues, something goes wrong and it’s simple and yet you stare at it for hours! (That’s an exaggeration, its only been ten minutes 😉 but it sounds better that way).
So here are the steps I followed:
1. I created a database using php my admin and then created a table in it:
CREATE TABLE `databasename`.`tablename` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`title` VARCHAR( 100 ) NULL ,
`long` SMALLINT NULL ,
`lat` SMALLINT NULL ,
) ENGINE = MYISAM
I have already caused my own problem … but I don’t know it yet. Can you spot the problem? Read on to find the answer! (more…)