thedigicraft / Atom.CMS

Atom.CMS
56 stars 50 forks source link

part 31 echo fullname #184

Open Jokuta opened 8 years ago

Jokuta commented 8 years ago

Hello,

I have a problem with data_user function, full name is not echoing out. I tried everything. it's part 31 from videos

_Here is my code in data.php _

function data_user($dbc, $id){

$q = "SELECT * FROM users WHERE email = '$id'"; $r = mysqli_query($dbc, $q); $data = mysqli_fetch_assoc($r); $data['fullname'] = $data['first_name'].' '.$data['last_name']; $data['fullname_reverse'] = $data['last_name'].', '.$data['first_name'];

return $data; }

and in navigation.php



</ul> 
creptor commented 8 years ago

Remember that for calling the user information you need to include a call to the function. Example:

$user=data_user($dbc,'$SESSION['email'])
//--> The session variable is the one where you have stored user email

sorry for the delay, but I was sick and the i got too busy with mothers day :P