$textfield = $_POST['textfield']; $host = "localhost"; $username = "root"; $pass = "root"; $dbname = "contagiousdb"; $link = mysql_connect($host,$username,$pass) or die("Connect mysql ERROR!"); mysql_select_db($dbname,$link) or die("connect Database ".$dbname." Error"); mysql_query("SET character_set_client = tis620"); mysql_query("SET character_set_connection = tis620"); mysql_query("SET character_set_database = tis620"); mysql_query("SET character_set_results = tis620"); mysql_query("SET character_set_server = tis620"); $newtable = "create table $textfield (id int(2) not null,name varchar(60) tis620_thai_ci not null , primary key(id))"; $result = mysql_query($newtable); if ($result) { echo "การเพิ่มชื่อโรคสำเร็จ"; } else { echo "ไม่สามารถเพิ่มได้"; }
<?php $result = mysql_query($newtable) or die(mysql_error()); ?>
$newtable = "create table $textfield (id int(2) not null,name varchar(60) tis620_thai_ci not null , primary key(id))"; $result = mysql_query($newtable);
$newtable = "CREATE TABLE `$textfield` (`id` INT( 2 ) NOT NULL ,`name` VARCHAR( 60 ) CHARACTER SET tis620 COLLATE tis620_thai_ci NOT NULL , PRIMARY KEY ( `id` ) ) ENGINE = MYISAM ;"; $result = mysql_query($newtable) or die(mysql_error());//ตรงนี้ผมทำตามคุณ MR.WIN แนะนำครับ
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง