gpt4 book ai didi

PHP 变量不在查询中求值

转载 作者:可可西里 更新时间:2023-10-31 22:52:44 24 4
gpt4 key购买 nike

<分区>

我是 PHP 和 MySQL 的新手,我就是搞不懂这个。我在论坛上到处搜索,但没有找到我能理解的答案。我最初使用的是 mysql_fetch_assoc() 但我只能搜索数字并且在搜索字母时也收到错误。我希望我在这里走在正确的轨道上。预先感谢您的所有帮助!

$con = mysqli_connect($hostname,$username,$password) or die ("<script language='javascript'>alert('Unable to connect to database')</script>");
mysqli_select_db($con, $dbname);

if (isset($_GET['part'])){
$partid = $_GET['part'];
$sql = 'SELECT *
FROM $usertable
WHERE PartNumber = $partid';

$result = mysqli_query($con, $sql);
$row = mysqli_fetch_assoc($result);

$partnumber = $partid;
$nsn = $row["NSN"];
$description = $row["Description"];
$quantity = $row["Quantity"];
$condition = $row["Conditio"];
}

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