Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // MySQLi connection
- $mysqli_link = mysqli_connect('HOST','USER','PASSWORD','DATABASE');
- $mysqli_link->set_charset('utf8'); // if needed, depending on your configuration
- // backward compatibility of old MySQL functions by rAthus
- function mysql_connect() {
- return true;
- }
- function mysql_select_db() {
- return true;
- }
- function mysql_query($q) {
- global $mysqli_link;
- return mysqli_query($mysqli_link,$q);
- }
- function mysql_fetch_array($r) {
- return mysqli_fetch_array($r,MYSQLI_ASSOC);
- }
- function mysql_num_rows($r) {
- return mysqli_num_rows($r);
- }
- function mysql_error() {
- global $mysqli_link;
- return mysqli_error($mysqli_link);
- }
- function mysql_insert_id() {
- global $mysqli_link;
- return mysqli_insert_id($mysqli_link);
- }
- function mysql_close($mysqli_link) {
- global $mysqli_link;
- return mysqli_close($mysqli_link);
- }
- // if you have errors like "this is incompatible with sql_mode=only_full_group_by", try enabling this:
- //mysqli_query($mysqli_link,'SET sql_mode=""');
Add Comment
Please, Sign In to add comment