i am attempting to store the users info in mysql db and return it to the browser window i am getting the row number of the data father than the data that should be stored in it. its been a while(pardon the pun) since i used mysql or php.
<?php
//connect to database
include('db-connect.php');
echo "<br/> echo user email: ". $user_profile['email'];
$fb_id = $user_profile['id'];
$fb_id = mysqli_real_escape_string($dbc,$fb_id);
//mysqli_real
//check if user exists
$check_user = mysqli_query($dbc , "SELECT * FROM users WHERE fb_id = '$fb_id';");
$check_user_result = mysqli_fetch_row($check_user);
if ($check_user_result[0] == 0) {
echo ' <br/> no such user exists';
$add_user = mysqli_query($dbc , "INSERT INTO users (user_id, email, first_name, last_name, fb_id) VALUES('','".$user_profile['email']."','".$user_profile['first_name']."','".$user_profile['last_name']."','".$user_profile['id']."')");
}
else{
echo " <br/> already registered <br/> should be an facebook ID before this". $fb_id;
$get_user_db_info = mysqli_query($dbc , "SELECT * FROM users");
while($row = mysqli_fetch_array($get_user_db_info)){
// then your for loop
echo '<br/>user_id: '.$row['user_id'].'<br/>email: '.$row['user_id'].'<br/>First Name: '.$row['user_id'];
}
}
?>
any help would be great and can provide more info if required.