Hello.

Has anyone transitioned easily from MYSQL to MYSQLI ?

my initial problem, is that I used to have (& do) have seperate functions..

function connect
{
Connects to DB
}


function one
{
SELECTS stuff
}

function two
{
SELECTS stuff
}

NEW connection code - MYSQLI

Code:
$con=mysqli_connect("localhost","wrong_user","my_password","my_db");
// Check connection
if (!$con)
  {
  die("Connection error: " . mysqli_connect_errno();
  }
From waht i can tell, you need to "pass" the $con variable with any / all select / update etc.. command.

has anyone got a good way of putting the connection rourtine into a function ? & preserving the connection between multiple functions / php scripts ?

I may have 2-3 selects / updates in each routine. depending on what action i use on the website.

If i can't have a connection in a single function, & preservbe it until the script ends - i'll need to connect / disconnect several times during the script process (once per select),