FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


[RESOLVED] PHP Error





krazycapital
Why do I keep getting the following error:
Code:
Fatal error: Call to undefined function mysql_connect() in c:\host\files\zportal\includes\db_connect.php on line 4


And here is the code:
Code:
<?php
if (defined("IN_PORTAL")) {
   include(PROOT."config.php");
   $connect = mysql_connect($dbhost,$dbuser,$dbpass)or die("Error with MySQL");
   $db = mysql_select_db($dbname,$connect)or die("Error with MySQL");
} else {
   die("Hacking Attempt");
}
?>


I have the extension enabled:
Code:
extension=php_ming.dll
;extension=php_mssql.dll
;extension=php_msql.dll
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll
;extension=php_openssl.dll


So what's wrong?
hexkid
krazycapital wrote:
Why do I keep getting the following error:
Code:
Fatal error: Call to undefined function mysql_connect() in c:\host\files\zportal\includes\db_connect.php on line 4


I have the extension enabled:
Code:
extension=php_ming.dll
;extension=php_mssql.dll
;extension=php_msql.dll
extension=php_mysql.dll
extension=php_mysqli.dll
;extension=php_oci8.dll
;extension=php_openssl.dll


So what's wrong?


Are you sure you enabled the extension in the right php.ini?
Try this to let PHP tell you what ini file it is using
Code:
<?php
function ini_path() {
  $p = get_cfg_var('cfg_file_path');
  if (!$p) {
    $p = '(not configured)';
  }
  return $p;
}

echo 'php.ini is at <tt><b>', ini_path(), '</b></tt>.';
?>
krazycapital
I figured out what was wrong. The extention_dir was set for "./" when it should have been "./ext/"

Thanks though!
orno
good job

resolved and -close-d
Related topics
[RESOLVED] RETARDED ERROR!
[RESOLVED] php-nuke error?
Fatal PHP error
[PHP] Error link
php error ?[parse error]
suddenly a php error on my website
PHP - Error
PHP Error Pages
[RESOLVED] php file upload problem
MySQL/PHP Error..
PHP error
Php error
[help=html,php]Error en forma de contacto...
XML/XHTML header problem
This topic is locked: you cannot edit posts or make replies.    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.