如果有人可以提供帮助,会出现此错误吗?
Mysql Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'active = 1' at line 1 Query: SELECT title FROM cms_resorts WHERE ID = 3AND active = 1
这是代码:
<?php
$courseRecords = $db->records('SELECT ID,title FROM '.$dbprefix.'resorts WHERE active = 1 ORDER BY sorting DESC');
for($i=0,$max=count($courseRecords);$i<$max;$i++){
$selected='';
if($validate->value('booking_resort')==$courseRecords[$i]->ID){
$selected='selected="selected"';
} ?>
<?php } ?>