Jump to content
MakeWebGames

Cronus Workshop


peterisgb

Recommended Posts

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?

YXDMURC.jpg

Because don't.

Edited by sniko
Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...