15.01.2013, 17:23
First of all, leaving control logics (like creating tables/columns) to the host language is not a good idea. You should create a proper DDL before you start using your database.
Anyways, the code to do it in PHP is:
New row:
Anyways, the code to do it in PHP is:
PHP код:
$query = "
CREATE TABLE `table_name` (
// All your columns go here, look up the mysql documentation
) ENGINE=InnoDB;
";
mysql_query($query);
PHP код:
$query = "
INSERT INTO `table_name` (variables) VALUES(values);
";
mysql_query($query);