Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试根据天气生成逻辑条件,或者使用下面的代码在表中没有值。回显的结果返回为 ["0"]。如何解析,以便 php 可以将值解释为布尔值?
$rowExists = mysql_query("SELECT EXISTS(SELECT 1 FROM table_name WHERE column_name = value)"); echo "result: ".json_encode(mysql_fetch_row($rowExists));
$result = mysql_query('SELECT COUNT(*) FROM table_name WHERE column_name = value') or die(mysql_error()); $count = mysql_result($result, 0, 0); if ($count > 0) { echo 'It exists!'; }