I´m very new to PHP. Im trying to send username and email as $_SESSION to index.php. I have tried resetting the pointer with mysql_data_seek($result,0); and then use mysql_fetch... Thanks in advance for your help.
$query = "SELECT * FROM `users` WHERE username='$username' and password='".md5($password)."'";
$result = mysqli_query($con,$query) or die(mysql_error());
$rows = mysqli_num_rows($result);
if($rows==1){
$_SESSION['email'] ="emailcolumn in $result"; //<---- How to set this?
$_SESSION['username'] = $username;
header("Location: index.php"); // Redirect user to index.php
}else{