-1
我試圖在phpMyAdmin中創建一個新列表,當用戶單擊網頁上的「創建新列表」按鈕但似乎無法使其工作時。 當我點擊「創建新的列表」我得到這個錯誤 -在phpMyAdmin中創建一個新表格,但單擊HTML中的提交按鈕
not working1 not working 3
Notice: Undefined variable: tablename in /strath-cis/2014/WEBSITE!/create_new_table.php on line 22
Notice: Undefined variable: tablename in /strath-cis/2014/WEBSITE!/create_new_table.php on line 22
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(id, tablename) VALUES(Null, '')' at line 1
下面的代碼
<?php
session_start();
$host=""; // Host name
$user_name=""; // Mysql username
$password=""; // Mysql password
echo "not working1";
// Create connection
mysql_connect("$host", "$user_name", "$password")or die("cannot connect");
// Check connection
$con=mysql_connect("","","iftercha") or die("Failed to connect to MySQL: " . mysql_error());
// Create table
// $tablename = $_POST['tablename'];
echo "not working 3";
$query ="CREATE TABLE $tablename (id, tablename)
VALUES(Null, '$tablename')";
$result = mysql_query($query) or die (mysql_error());
?>
其中u定義烏爾表名? – 2015-03-03 12:34:13
你實際上是在編輯PHPMySQL應用程序還是你的意思是MySQL? – Quentin 2015-03-03 13:21:19