Logon routine - What is resource id='7' tpe='mysql link'?

I keep Google searching my code to find the word Deprecated used more often than not. The following PHP code is used to log into the database.

[php]
function mysql_logon()
{
$mysql_link = @mysql_connect(kDB_HOST, kDB_USER, kDB_PASS) OR die (kServerError);
@mysql_select_db(kDB_NAME, $mysql_link) OR die (kDBError);
return $mysql_link;
}
[/php]

When I step through NetBeans, the $mysql_link is returning resource id=‘7’ type=‘mysql link’. What does this indicate? Is this a successful return?

You should change to use a newer library (mysqli or pdo), pdo came out 10 years ago, so it’s about time.

I surprised the calls are not PDO.

My goal right now is simply to get the test environment to work. Do you know where I can look up the return values?

Yes. It is a resource meant to be used. If it was unsuccessful you would get a die (kServerError). Also, switch to mysqli now before you code any more. It’s almost identical procedurally, or learn PDO.

Also, switch to mysqli now before you code any more. It's almost identical procedurally, or learn PDO.

I want to switch. The software in this system is lackluster. I am simply trying to get through it day-by-day.

My goal at the moment is trying to get a development system working.

Sponsor our Newsletter | Privacy Policy | Terms of Service