Just about to move from a local to a remote database. Is there anything else I should worry about except
for :
a) specifying the database e.g.
changed to
and
b) programming for responses to connectivity errors?
e.g.
for example if the connection is down.
I assume there may be an issue with creating a link once (e.g. require dbconnect.php) and closing and reopening connections as needed), but unless the connection is very bad, I'd keep it open.
Am I missing something here?
for :
a) specifying the database e.g.
Code:
$link = new mysqli('localhost', $dbusername, $dbpasswd, $db);
Code:
$link = new mysqli('[URL unfurl="true"]http://www.mybdsite.org/database_path/',[/URL] $dbusername, $dbpasswd, $db);
and
b) programming for responses to connectivity errors?
e.g.
Code:
if ($mysqli->connect_error) {
echo "error: $mysqli->connect_errno message: $mysqli->connect_error";
die('Connect Error (' . $mysqli->connect_errno . ') '
. $mysqli->connect_error);
for example if the connection is down.
I assume there may be an issue with creating a link once (e.g. require dbconnect.php) and closing and reopening connections as needed), but unless the connection is very bad, I'd keep it open.
Am I missing something here?