kryptonite Posted January 14, 2010 Share Posted January 14, 2010 ok first off open up the v1 code you have that you want to convert to v2! then find this in the code session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); then replace it to this include "globals.php"; Then find this in the code mysql_ replace to $db-> Then find this in the code fetch_array replace to this fetch_row And thats is thats the (basics) Have fun ! Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted November 27, 2013 Share Posted November 27, 2013 There's a bit more to it than that. Forgive the gravedig. If done in this order, you should be ok Find: session_start(); require "global_func.php"; if($_SESSION['loggedin']==0) { header("Location: login.php");exit; } $userid=$_SESSION['userid']; require "header.php"; $h = new headers; $h->startheaders(); include "mysql.php"; global $c; $is=mysql_query("SELECT u.*,us.* FROM users u LEFT JOIN userstats us ON u.userid=us.userid WHERE u.userid=$userid",$c) or die(mysql_error()); $ir=mysql_fetch_array($is); check_level(); $fm=money_formatter($ir['money']); $cm=money_formatter($ir['crystals'],''); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm,$cm); $h->menuarea(); Replace with: include(__DIR__ . '/globals.php'); [color=red]Find:[/color] [code]mysql_ Replace with: $db-> Find: fetch_array Replace with: fetch_row Find: fetch_assoc Replace with: fetch_row Find: real_escape_string Replace with: escape Find: ->result Replace with: ->fetch_single Find: (note the space: "global ") global Replace with: global $db, Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.