Ich erhalte Fehlermeldung beim Ausführen auf localhost. folgende msg bekomme ich. Ich habe auch den DB-Verbindungscode hinzugefügt.Fehlermeldung beim Ausführen auf localhost erhalten
(!) Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C:\wamp\www\common\conf\database.conf.php on line 51
Call Stack
# \t Time \t Memory \t Function \t Location
1 \t 0.0470 \t 142760 \t {main}() \t ..\index.php:0
2 \t 0.4050 \t 634848 \t require_once('C:\wamp\www\common\conf\database.conf.php') \t ..\index.php:16
3 \t 0.4060 \t 635416 \t mysql_connect () \t ..\database.conf.php:51
Database connection code
<?php
/*******************************************************
* File name: database.conf.php
*
* Purpose: this file is used to store database
* table name constants and it also starts
* the database connection
*
* CVS ID: $Id$
*
********************************************************/
// If main configuration file which defines VERSION constant
// is not loaded, die!
if (! defined('VERSION'))
{
echo "You cannot access this file directly!";
die();
}
// Please note:
// in production mode, the database authentication information
// may vary.
define('DB_USER', 'root');
define('DB_PASS', '');
//
define('DB_NAME', 'myrentbd-db');
define('DB_HOST', 'localhost');
/**
* Common Table Constant
*/
// Common Tables
define('APP_INFO_TBL', DB_NAME . '.app_info');
define('APP_LANGUAGE_TBL', DB_NAME . '.app_language');
define('APP_MESSAGE_TBL', DB_NAME . '.app_message');
define('APP_META_TBL', DB_NAME . '.app_meta');
define('APP_PROFILE_TBL', DB_NAME . '.app_profile');
define('COUNTRY_LOOKUP_TBL', DB_NAME . '.country_lookup');
define('US_STATE_TBL', DB_NAME . '.us_states');
define('DOCUMENT_TBL', DB_NAME . '.document');
define('GROUP_TBL', DB_NAME . '.group');
if (AUTO_CONNECT_TO_DATABASE)
{
$dbcon = mysql_connect(DB_HOST, DB_USER, DB_PASS) or die("Could not connect: " . mysql_error());
mysql_select_db(DB_NAME, $dbcon) or die("Could not find: " . mysql_error());
}
?>
Die mysql-PHP-Erweiterung ist tot - Beenden Sie die Verwendung der mysql-PHP-Erweiterung. Es ist alt, seit PHP 5.5 veraltet und in PHP 7.0 vollständig entfernt. Verwenden Sie stattdessen mysqli oder PDO_mysql. Und mischen Sie sie nicht –
Mysql_ * Funktionen sind veraltet. Außerdem sind sie unsicher [Veraltete Funktionen in PHP 5.5.x] (http://php.net/manual/de/migration55.deprecated.php). Sie sollten lieber mysqli_ functions oder besser PDO mit vorbereiteten Anweisungen verwenden. – BenRoob