Can someone please help me with this. I have a file with my function in it, and when I load a page that includes this file, I get this error:
Fatal error: Cannot redeclare showsuccess() in /home/www/htdocs/admin/header.php on line 6
Here is the function
function dropdown($table, $name) {
include "admin/lib.mysql.php";
$query="SELECT * FROM $table ORDER BY $name ASC;";
$result=mysql_db_query($dbname, $query, $dblink);
if ($row=mysql_fetch_array($result)) {
//print "<select>";
do {
printf("<option value=\"%s\">%s</option>\n", $row["$name"], $row["$name"]);
} while ($row = mysql_fetch_array($result));
}
}
The moment I have this function in say lib.mysql.php, and I call it from another file, called branch.php as follows:
? print dropdown(branch,b_name); ?>, and lib.mysql.php is included in branch.php, it tells me it cannot redeclare dropdown() in lib.mysql.php.
Why not?