MySQL PHP
#2

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:

PHP код:
$query "
    CREATE TABLE `table_name` (
        // All your columns go here, look up the mysql documentation
    ) ENGINE=InnoDB;
"
;
mysql_query($query); 
New row:

PHP код:
$query "
    INSERT INTO `table_name` (variables) VALUES(values);
"
;
mysql_query($query); 
Reply


Messages In This Thread
MySQL PHP - by AphexCCFC - 15.01.2013, 17:08
Re: MySQL PHP - by Sinner - 15.01.2013, 17:23
Re: MySQL PHP - by AphexCCFC - 15.01.2013, 19:20
Re: MySQL PHP - by Sinner - 17.01.2013, 10:47

Forum Jump:


Users browsing this thread: 2 Guest(s)