Impossible Posted April 3, 2009 Posted April 3, 2009 I need some help converting php's from I think v1 to v2. If anyone knows how to do this, please MSN me. ([email protected]) Thanks. Quote
MyGunWars Posted April 3, 2009 Posted April 3, 2009 Re: Help with Conversion... IM Me Its Easy [email protected] To convert a v2 mod to work with v1: }Open the v1 mod you wish to convert and find then 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']); $lv=date('F j, Y, g:i a',$ir['laston']); $h->userdata($ir,$lv,$fm); $h->menuarea(); }Replace it with this: include "globals.php"; _______________________________________________________________________________ }Find: mysql_ }Replace it with this: $db-> }Find: fetch_array }Replace it with this: fetch_row Much safer to do it this way and you're done. You know that the sql querys in v2 are written differently than in v1, but that doesnt matter, the usual mysql_query will work just the same, there is no need to change it. Quote
Uridium Posted April 3, 2009 Posted April 3, 2009 Re: Help with Conversion... Find: fetch_array }Replace it with this: fetch_row Sometimes doing the above can cause other errors i would leave them as they are for now and as you stated before do the first parts. Iv'e found in some cases where ive changed the array to row doesnt always do justice... Quote
Lithium Posted April 3, 2009 Posted April 3, 2009 Re: Help with Conversion... I need some help converting php's from I think v1 to v2. If anyone knows how to do this, please MSN me. ([email protected]) Thanks. http://criminalexistence.com/ceforums/i ... ic=16666.0 Quote
Magictallguy Posted April 4, 2009 Posted April 4, 2009 Re: Help with Conversion... Find: fetch_array }Replace it with this: fetch_row Sometimes doing the above can cause other errors i would leave them as they are for now and as you stated before do the first parts. Iv'e found in some cases where ive changed the array to row doesnt always do justice... Chances are you haven't globally defined the $db variable. Quote
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.