Jump to content

shimabuku

New Members
  • Posts

    4
  • Joined

  • Last visited

shimabuku's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. When I change it to below. I just get an internal 500 error. Nothing in the logs. $link = mysqli_connect($DB_HOST, $DB_USER, $DB_PASSWORD); mysqli_select_db($link, $DB_DATABASE);
  2. The original parts were; mysql_connect($DB_HOST, $DB_USER, $DB_PASSWORD) or die("SQL ERROR: Can't Connect to DB"); mysql_select_db($DB_DATABASE) or die("SQL ERROR: Can't select DB"); So i figured I'd just change it to mysqli_connect and mysqli_select_db since it's PHP7.X.
  3. Hello all! New here and new to PHP. I have an old script that was built for PHP 5.X and need some help getting it to work with PHP 7.X. According to the PHP manual I need to pass the db connection as the first argument. I do get the display error "SQL Error: Can't select DB" and in the logs show "PHP Warning: mysqli_select_db() expects exactly 2 parameters, 1 given". <?php extract($_REQUEST); $DB_HOST="localhost"; //Host $DB_DATABASE="babyyoda"; //database name $DB_USER="mando"; //database username $DB_PASSWORD="password"; //databse password $ADMIN_EMAIL='admin@example.com'; $TEMPLATES='./templates/'; $URL_BASE='http://example.com/banners/'; $PATH='/var/www/vhosts/example.com/httpdocs/banners/'; $BANNERS_PATH=$PATH.'banners/'; $BANNERS_URL=$URL_BASE.'banners/'; $DB_TABLE_CATEGORIES='ban_categories'; $DB_TABLE_SUBCATEGORIES='ban_subcategories'; $DB_TABLE_SUBCATEGORIES_BANNERS='ban_subcategories_banners'; $DB_TABLE_BANNERS='ban_banners'; $DB_TABLE_USERS='ban_users'; $DB_TABLE_SETTINGS='ban_settings'; $IMAGE_MAGICK_PATH='/usr/bin/'; //$IMAGE_MAGICK_PATH='/usr/local/bin/'; // on some servers it may be like this $TEMPLATE_EXECUTE_PHP=1; // set to 1 to allow use of php inside of templates $CRYPT_SALT='ef&dF%HGRTSvsw35'; $TYPES[1]='Jpeg'; $TYPES[2]='Gif'; $TYPES[3]='Flash'; // dont change flash should be "3" //$LINKED_SCRIPTS['Galleries Manager']='/galleries/admin/'; //$LINKED_SCRIPTS['Flash Manager']='/flash/admin/'; $NATS=0; //$PASS_VARIABLES=array('campaign','program'); define('CONFIG_INCLUDED',1); mysqli_connect($DB_HOST, $DB_USER, $DB_PASSWORD) or die("SQL ERROR: Can't Connect to DB"); mysqli_select_db($DB_DATABASE) or die("SQL ERROR: Can't select DB"); error_reporting(0); ini_set('session.gc_maxlifetime',3600); ?> I came up with the below but I don't know where to insert these two statements and what to remove. $link = mysqli_connect($DB_HOST, $DB_USER, $DB_PASSWORD); mysqli_select_db($link, $DB_DATABASE);
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.