This may be the most simple thing to do in php. Forgive me, I am from the .net world where all this is simple. all I want is what this query is:
PHP Code:
session_start();
include "connectTo.php";
$link = connectTo();
$id = $_SESSION['email'];
$table = "users";
$query = "SELECT role FROM $table WHERE username ='$id'";
$result = mysql_query($query,$link);
if (!$result) {
$message = 'Invalid query: ' . mysql_error() . "\n";
$message .= 'Whole query: ' . $query;
die($message);
}
while ($row = mysql_fetch_assoc($result)) {
echo $row['username'];
}
how do i echo or get this comparison so I can set up a switch on the result?