I have now spent over 3 hours trying to make this code work properly with mysqli extention in php. I already know that there is a user with userid 4 but when i try to use mysql prepared statement with [MYSQLI EXT], the code fails,and if it passes the test, i only see a blank page. Somebody please help me.
The code snipe is below in php.
<?php
//testing...
require_once('connections/connections.php');
ini_set('display_errors',true);
$received_id=4;//from the client...
function synchronize(){
global $con, $received_id;
$check_db=$con->prepare("SELECT FIRSTNAME,LASTNAME,USERNAME FROM SUPERDATATABLE WHERE USERID=?");
$check_db->bind_param('i',$received_id);
$check_db->execute();
if($check_db->num_rows>0){
$check_db->bind_result($first_name,$last_name,$user_name);
$check_db->fetch();
echo $first_name.'+'.$last_name.'+'.$user_name;
}else{
echo 'Sorry, but this did not work';
}
}synchronize();