Jump to content


Photo

session if


  • Please log in to reply
1 reply to this topic

#1 corillo181

corillo181
  • Members
  • PipPipPip
  • Advanced Member
  • 896 posts

Posted 17 May 2006 - 07:30 AM

ok i wasn trying to build a page just for users where levle is set to 5.. but i got stuck how would i go about this

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]<?php
session_start();
include_once 'db.php';
$con=mysql_query("SELECT username FROM users WHERE level='5'");
$fetch=mysql_fetch_array($con);
$min=$_SESSION['username']=$fetch['username'];
?>
[/quote]

how would i go about if the usernmae level is 5 echo something

#2 alpine

alpine
  • Members
  • PipPipPip
  • Advanced Member
  • 756 posts
  • LocationNorway

Posted 17 May 2006 - 09:16 AM

I'm not sure if i understand you fully, but you could pass on the users level in a different session to load based on their level, so
$level = $_SESSION['level'];
$con=mysql_query("SELECT username,level FROM users WHERE level='$level'");

echo $level;





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users