【发布时间】:2009-08-18 16:16:51
【问题描述】:
如何检查一个空的数据库结果,然后基于此执行操作?
我的代码将匹配结果放入 if -clause
while( $tags_and_Qid = pg_fetch_array( $result_tags )) {
// Add the Tag to an array of tags for that question
$end_array [ $tags_and_Qid['question_id'] ] ['tag'] [] = $tags_and_Qid['tag'];
}
if ( $end_array [ $tags_and_Qid['question_id'] ] ['tag'] == '' ) {
// Problem here!
header( "Location: index.php?"
. "no_question_found"
);
}
【问题讨论】:
标签: php database postgresql