hi !
what the erong with this code, am trying to do banner script, wich load images random by zone !
the error msg :PHP Code:
<?require("db.php");?>
<?
function banner($action, $ident) {
if ($action == 'dynamic') {
$banners_query = mysql_query("select count(*) as count from $table where active = 'yes' and zone = '" . $ident . "'");
$banners = mysql_fetch_array($banners_query);
echo mysql_error();
if ($banners['count'] > 0) {
$banner = ("select id, company, image ,link ,html from $table where active = 'yes' and zone = '" . $ident . "'");
} else {
return '<b>TEP ERROR! (banner(' . $action . ', ' . $ident . ') -> No banners with group \'' . $ident . '\' found!</b>';
}
}}
echo banner('dynamic','max');
?>
thx alot !Code:Warning: Supplied argument is not a valid MySQL result resource in c:/foxserv/www/maviads/vi.php on line 15 You have an error in your SQL syntax near 'where active = 'yes' and zone = 'max'' at line 1TEP ERROR! (banner(dynamic, max) -> No banners with group 'max' found!




Bookmarks