gpt4 book ai didi

php - Mysql - 查看值是否已存在

转载 作者:行者123 更新时间:2023-11-29 17:27:54 25 4
gpt4 key购买 nike

我只是想知道如何解决这个问题。在我的数据库中:here我的值为 123。我的代码正在搜索它,但没有找到它。

<html>
<head>
<?php
$userid = 123;
$con = mysqli_connect("","","*","");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}else{
echo "Connected";
}
echo "123";
// Perform queries
$sql_fetch_id = "SELECT * FROM AccessedIds WHERE 64id = '123";
$query_id = mysqli_query(sql2242953, $sql_fetch_id);
if(mysqli_num_rows($query_id) ==0) {
echo "empty";
}else{
echo "full";
}
mysqli_close($con);
?>
<title>PHP Test</title>
</head>
<body>

</body>
</html>

Data types

最佳答案

您的查询错误,请尝试:

$query_id = mysqli_query($con, $sql_fetch_id);

More information

同样如上面的注释,删除 123 之前的单引号。

关于php - Mysql - 查看值是否已存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50863257/

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