gpt4 book ai didi

mysql - 为什么我在 $result 中得到结果

转载 作者:行者123 更新时间:2023-11-29 06:55:01 26 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Why do I get “Resource id #4” when I apply print_r() to an array in PHP?
How do i “echo” a “Resource id #6” from a MySql response in PHP?

为什么我在 $result 中得到“Resource id #6”?想要 1 或 0 :P

$sql = "SELECT * FROM members WHERE rchat=1 LIMIT 1";
$result = mysql_query($sql);

if (!$result) {
unlink($fn);
//$fn = $_SESSION['sess_user'].'.txt';
$fn = 'hittaingen.txt';
mysql_query("UPDATE members SET rchat=1 room='" . $_SESSION['sess_user'] . "' WHERE user='" . $_SESSION['sess_user'] . "'");
}

else {
//$fn = $result['room'].'.txt';
$fn = 'hitta.txt';
mysql_query("UPDATE members SET rchat=2 room='" . $result['room'] . "' WHERE user='" . $_SESSION['sess_user'] . "'");
}

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