peterisgb Posted September 24, 2014 Share Posted September 24, 2014 A while back i got Cronus workshop mod. i'm running a game on wamp and i was wondering if anyone has a upto date mysqli version of this and i changed mine to mysqli and it still dont work Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted September 25, 2014 Share Posted September 25, 2014 Well it should be using the database class if your using V2. So if your config file is set to use mysqli then just make sure that Cronus isn't using any mysql_* functions inside the code Quote Link to comment Share on other sites More sharing options...
peterisgb Posted September 25, 2014 Author Share Posted September 25, 2014 well i went through his script and changed it to mysqli and it still dont quite work. i know its set to mysqli in config as MTG coded my class for me. Quote Link to comment Share on other sites More sharing options...
sniko Posted September 25, 2014 Share Posted September 25, 2014 (edited) well i went through his script and changed it to mysqli and it still dont quite work. i know its set to mysqli in config as MTG coded my class for me. You didn't just add an i at the end where it said mysql, did you? Because don't. Edited September 25, 2014 by sniko Quote Link to comment Share on other sites More sharing options...
peterisgb Posted September 25, 2014 Author Share Posted September 25, 2014 You didn't just add an i at the end where it said mysql, did you? Because don't. oh erm..... yeah i did lol. what should i do lol. Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted September 25, 2014 Share Posted September 25, 2014 Change it back and convert it over to the database class. I don't know much about MTG's mysqli wrapper to really help you out Quote Link to comment Share on other sites More sharing options...
Script47 Posted September 25, 2014 Share Posted September 25, 2014 It would be really helpful if it does show any errors that you post them on here. That will at least give us a clearer idea where you're going wrong. Quote Link to comment Share on other sites More sharing options...
G7470 Posted September 25, 2014 Share Posted September 25, 2014 When converting from mysql to mysqli, if done using the procedural language style like such: $result = mysql_query("/* QUERY GOES HERE */"); You have to add the database connection as a parameter BEFORE the query itself. So, as long as you have your configuration file included somehow (through header or some other header file), then all you will have to do is use the variable that connects to the database. Usually, in your config file, the variable you want to use is assigned something like this: $con = mysqli_connect('/* HOST */','/* USERNAME */', '/* PASSWORD */', '/* DATABASE NAME */') or die("Error ".mysqli_error($con)); So, $con is the variable to use. Then, for mysqli_query, you would make those look like this: $result = mysqli_query($con, "/* QUERY GOES HERE */"); For more information of the mysqli php class, check out here: http://php.net/manual/en/class.mysqli.php 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.