Skip to content

Commit

Permalink
put back old mysql_connect() function for legacy support
Browse files Browse the repository at this point in the history
  • Loading branch information
dbursem committed Feb 6, 2015
1 parent 43e40c5 commit b1dd4b1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions sql.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,21 @@
catch (PDOException $e) {
echo 'Connection failed: ' . $e->getMessage();
}

//legacy mysql_connect for non-released code:

$link;
if (!($link = @mysql_connect($cfg['db_host'], $cfg['db_user'], $cfg['db_pass'] ))) //
{
echo "<BR><BR><CENTER>Connection not possible</CENTER><BR><BR>";
@mysql_close($link);
exit();
}

if (!(@mysql_select_db ($cfg['db_name'],$link)))
{
echo "<BR><BR><CENTER>Database access not possible</CENTER><BR><BR>";
@mysql_close($link);
exit();
}
// ***************************************************************************

0 comments on commit b1dd4b1

Please sign in to comment.