Hi,
Just installed php 4.2.1 with Win2K/IIS. Everything seems fine, except I have this page that gives me this error:
"Fatal error: Cannot redeclare db_connect() (previously declared in C:\Inetpub\wwwroot\ethan\inc\common_db.php:24) in C:\Inetpub\wwwroot\ethan\inc\common_db.php on line 22"
For soem reason it thinks the function is has been previously redeclared on the first line of code inside the function. WHat?!
Here's the function...
22 function db_connect() {
23
24 global $dbhost, $dbusername, $dbuserpassword, $default_dbname;
25 global $MYSQL_ERRNO, $MYSQL_ERROR;
26
27 $link_id = mysql_connect($dbhost, $dbusername, $dbuserpassword);
28 if(!$link_id) {
29 $MYSQL_ERRNO = 0;
30 $MYSQL_ERROR = "Connection has failed to the host $dbhost.";
31 return 0;
32 }
33 else if(empty($dbname) && !mysql_select_db($default_dbname)) {
34 $MYSQL_ERRNO = mysql_errno();
35 $MYSQL_ERROR = mysql_error();
36 return 0;
37 }
38 else return $link_id;
39}
Any insight would be greatly appreciated!
Thanks,
Sam