<?php
phpinfo
php $connect = mysql_connect(“localhost:3306”, “thebigsh_formdata”, “GaryJones123”);
if (!connect) { die('Connection Failed: ' . mysql_error());
{ mysql_select_db(“database_name”, $connect);
$user_info = “INSERT INTO table_name (username, email) VALUES ('$_POST[username]', '$_POST[email]')”;
if (!mysql_query($user_info, $connect)) { die('Error: ' . mysql_error());
} echo “Your information was added to the database.”; mysql_close($connect);
header('Location: http://thebigsheep.x10.bz/page2.html');
?>
我想我的网站链接到SQL数据库上X10主机。但它不工作?
有谁知道为什么?
这是我的PHP代码我使用
我似乎已经忘记了我在家里的魔法水晶球。有人可以借我一个吗?但现在认真,你需要发布更多的信息。 – Andrew
<?php phpinfo php $ connect = mysql_connect(“localhost:3306”,“thebigsh_formdata”,“GaryJones123”);如果(!connect){die('Connection Failed:'。mysql_error()); {mysql_select_db(“database_name”,$ connect); ('$ _POST [用户名]','$ _POST [email]')“;或者用户名和密码。 (!mysql_query($ user_info,$ connect)){die('Error:'。mysql_error()); “您的信息已添加到数据库中。”; mysql_close($连接); header('Location:http://thebigsheep.x10.bz/page2.html'); ?> –
你的代码是什么? –