/*** mysqli way **************************/
$link = Helper2::connectToDb();
$sql = "select * from xxxx";
$query = mysqli_query($link, $sql);
/*********************************************/
Lami’s notes on how to use it are below:
• change the way database connection is fetched
• change $link = connectToDB() to $link = Helper2::connectToDb();
• change instances of mysqli
• change mysql_query($xyz) to mysqli_query($link, $xyz)
• change instances of mysql_real_escape_string
• change mysql_real_escape_string($xyz) to mysqli_real_escape_string($link, $xyz)
• change instances of mysql_error
• change mysql_error() to mysqli_error($link)
• change instances of mysqli_insert_id
• change mysqli_insert_id() to mysqli_insert_id($link)
• do a find and replace of other old mysql functions
• search for mysql_ and replace with mysqli_ (NOTE: only do this on page you're testing)