diff --git a/reference/mysql/functions/mysql-result.xml b/reference/mysql/functions/mysql-result.xml index 5b65d4e061..3031847cda 100644 --- a/reference/mysql/functions/mysql-result.xml +++ b/reference/mysql/functions/mysql-result.xml @@ -80,6 +80,9 @@ $link = mysql_connect('localhost', 'mysql_user', 'mysql_password'); if (!$link) { die('Could not connect: ' . mysql_error()); } +if (!mysql_select_db('database_name')) { + die('Could not select database: ' . mysql_error()); +} $result = mysql_query('SELECT name FROM work.employee'); if (!$result) { die('Could not query:' . mysql_error());