Forum Moderators: coopster

Message Too Old, No Replies

PHP 5.6 -> 7.1

         

smagdy

12:25 pm on Dec 25, 2018 (gmt 0)

10+ Year Member



Hi

I am migrating to PHP7.1 and testing with simple code but it doesnt give any error and it doesnt display anything..

what could be wrong ?

<?php
$link = mysqli_connect('SERVER', 'USERNAME', 'PASSWORD'); REAL VALUE IS IN THE CODE

if (!$link) {
die('Could not connect: ' . mysqli_error()); } else {
mysqli_select_db('simmoworldfood_com', $link); }


$getName = mysqli_query('SELECT name FROM `subCatName` WHERE id = 1 LIMIT 1');
$x = mysqli_fetch_object($getName);
echo $x->name;

?>

Gibisan

10:57 am on Dec 26, 2018 (gmt 0)

10+ Year Member



You are missing the db name

$link = mysqli_connect('SERVER', 'USERNAME', 'PASSWORD', 'DB_NAME');