OK, that's the function that has been nearest of what i'm trying to do:
PHP Code:
function club() {
$result = mysql_query("SELECT * FROM es WHERE zona ='and'");
while ($row = mysql_fetch_array($result)) { //gets error here
$output = "<a href=\"$php_self?content=$row[idn]\">".stripslashes($row[nom])."</a><br>";
}
echo $output;
}
function es($id) {
$result = mysql_query("SELECT * FROM `es`
WHERE ((`zona` ='and') AND (`idn` = '$id'))");
while ($row = mysql_fetch_array($result)) { //error here too
$output = "<h3>$row[nom]</h3>";
$output .="<br>".stripslashes($row[poblacio])."<br>";
}
return $output;
}
And the output result errors are:
"Warning: Supplied argument is not a valid MySQL result resource in ..."
Then I call them:
PHP Code:
echo club();
echo es($content);
Bookmarks