php - inserting data from form to mysql database -
i using php send info form mysql info base, when utilize code:
$sql = "create table myguests ( id int(6) unsigned auto_increment primary key, name varchar(30) character set utf8 collate utf8_unicode_ci not null, phone varchar(60) not null, password varchar(60) character set utf8 collate utf8_unicode_ci not null, email varchar(50), pelak varchar(50) character set utf8 collate utf8_unicode_ci, reg_date timestamp )";
it works perfectly, when use:
$field_table = $_post['phone']; $sql = "create table '{$field_table}' ( id int(6) unsigned auto_increment primary key, name varchar(30) character set utf8 collate utf8_unicode_ci not null, phone varchar(60) not null, password varchar(60) character set utf8 collate utf8_unicode_ci not null, email varchar(50), pelak varchar(50) character set utf8 collate utf8_unicode_ci, reg_date timestamp )";
it create table in phpmyadmin gives error "#1146 - table 'username.table_name' doesn't exist"
php mysql forms table
No comments:
Post a Comment