Hi.
You have asked what exactly is wrong with the script and what message is being given.
This is the message that I am consistently receiving is;
mysqli_real_escape_string() expects exactly 2 parameters, 1 given
I think that I have somehow crashed my apache system and it is no longer reading mysqli functions. I think that I somehow crashed the system ( or created an internal bug when I tried to combine two types of connections) ;
I tried to combine the old
mysql connect
with the new
mysqli connect ( I have enclose both below. )
I did this because I got downloaded some scripts that were in the old mysql mode and then drafted some new scripts that were in the mysqli mode.
Prior to trying to combine the two types of connection my login script was working perfectly and had no problems.
However , once I tried to combine the two database connection types I immediately started having problems all over my scripts.
For example , I enclose below a function. This function worked perfectly when I used the mysql connection but simply does not work when I try to use the mysqli fucntions.
Function Reg11 ( $user_id= null )
{
global $dbc;
$pair = array();
$select = "SELECT
addjobssought ";
$from = " FROM
fam_add_jobs_sought ";
$where = sprintf(" WHERE
user_id = '%s' ",
mysqli_real_escape_string($user_id)
);
$order = " ORDER BY user_id DESC LIMIT 1 ";
$query2 = $select.$from.$where.$order;
$result2 = mysqli_query($query2);
confirm_query ($result2);
$pair[]= db_result_to_array($result2);
return $pair;
}
print_r (Reg11 (5 ));
Regarding the login script
I have gone over this login script a hundred times and there is no logical reason why it should not work; the only logical reason that I have is that I somehow crashed my system when I tried to combine the two database connection types.
So, in conclusion. Is it possible that I am correct. If so, how can I purge the system .
// Make the connection:
$dbc = mysqli_connect (DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
if (!$dbc) {
trigger_error ('Could not connect to MySQL: ' . mysqli_connect_error() );
}
function db_connect()
{ $connection = mysql_pconnect('localhost', 'namec', 'password');
if(!$connection) {
return false;
}
if(!mysql_select_db('jobolicious'))
{ return false;
}
return $connection;
}