ok. what happened when you ran it? does it show any errors ? i can see the insert example does not have any debugging code. you can check mysql_query() return value that if it successfull or not. if failed echo the reason using mysql_error() $res=mysql_query("INSERT INTO Persons (FirstName, LastName, Age)VALUES ('Peter', 'Griffin',35)"); if(!$res)echo mysql_error(); http://php.net/mysql_error