首页 > 编程知识 正文

mysql隔离级别存在问题,mysqlsetpassword语法错误

时间:2023-05-03 15:45:09 阅读:275188 作者:1706

The error...

Warning: mysql_fetch_assoc() expects

parameter 1 to be resource, boolean

given in

/home/andar/public_html/sistema/admin/cron.php

on line 19

$hoje = strtotime(date("d-m-Y"));

$db = new DBConfig();

$db -> config();

$db->conn();

$query = mysql_query("SELECT * FROM products WHERE auto_pub = ".$hoje) or die(mysql_error());

while($res = mysql_fetch_assoc($query)) {

$query = mysql_query("UPDATE products SET publicado = '0' WHERE auto_pub = ".$hoje) or die(mysql_error());

}

$db->close();

$query is used before the while and inside the while... Change the name of the variable to $query2, for example:

$hoje = strtotime(date("d-m-Y"));

$db = new DBConfig();

$db -> config();

$db->conn();

$query = mysql_query("SELECT * FROM products WHERE auto_pub = ".$hoje) or die(mysql_error());

while($res = mysql_fetch_assoc($query)) {

$query2 = mysql_query("UPDATE products SET publicado = '0' WHERE auto_pub = ".$hoje) or die(mysql_error());

}

$db->close();

Hope it helps.

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。