gpt4 book ai didi

php - 为什么我不能用 PHP 发布到我的 mysql 数据库?

转载 作者:行者123 更新时间:2023-11-30 22:07:06 26 4
gpt4 key购买 nike

大家好

我搜索了又搜索,但似乎无法弄清楚我的脚本究竟有什么问题。我只是想通过 PHP 向 MySQL DB 中插入一行,它会显示所有步骤,但不会更新表中的记录。我的脚本是

<?php 
$link = mysql_connect('callingonchristcom.ipagemysql.com', 'jhedge', 'mypw');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_select_db('user');
echo 'Step Two';
$mysqlstr="INSERT INTO users (FirstName,LastName,UserName,Password) VALUES ('John','Hedge','jhedge','mypw');";
echo 'Step Three';
mysql_query($myquerystr);
echo 'Step Four';
mysql_close($link);
?>

最佳答案

您的查询变量是 $mysqlstr 并且您在 mysql_query 中使用了 $myquerystr 所以不会插入

关于php - 为什么我不能用 PHP 发布到我的 mysql 数据库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41295172/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com