Jump to content

I'm trying


ronnie88

Recommended Posts

yea, but how would i go about developing the if session code... is equal to the username and so and so admin column..? i tried this
[code]
if($row['admin']== 'admin'){
  echo "test1";
}

 

and added admin to the admin column

and the top of the page

if(isset($_SESSION['username']) && !empty($_SESSION['username'])) {
$query  = "SELECT va, cash, forum, admin FROM virtuala WHERE username='{$_SESSION['username']}'";
$result = mysql_query($query);
}
?>

but no luck[/code]

Link to comment
https://forums.phpfreaks.com/topic/116510-im-trying/#findComment-599132
Share on other sites

i tried using a variable such as:

<?session_start();
include("database.php");
if($_SESSION['username']) {
$query  = "SELECT * FROM virtuala WHERE username='{$_SESSION['username']}'";
$result = mysql_query($query);
}
$admin = $row['admin'];
?>

if($admin == 'admin'){
  echo "test1";
}
  else{
    echo "help me";
}

?>

but still no luck.. and tried using a mysql error no errors..

Link to comment
https://forums.phpfreaks.com/topic/116510-im-trying/#findComment-599146
Share on other sites

this is wrong

<?session_start();

include("database.php");

if($_SESSION['username']) {

$query  = "SELECT * FROM virtuala WHERE username='{$_SESSION['username']}'";

$result = mysql_query($query);

}

$admin = $row['admin'];

?>

 

it should be , short tag should not be used

<?php

session_start();

include("database.php");

if($_SESSION['username']) {

$query  = "SELECT * FROM virtuala WHERE username='{$_SESSION['username']}'";

$result = mysql_query($query);

}

$admin = $row['admin'];

?>

Link to comment
https://forums.phpfreaks.com/topic/116510-im-trying/#findComment-599151
Share on other sites

i've tried this now too

<?php
session_start();
include("database.php");
if($_SESSION['username']) {
$query  = "SELECT * FROM virtuala WHERE username='{$_SESSION['username']}'";
$result = mysql_query($query);
}
$admin = "{$row['admin']}";
?>

 

<?php
if($admin == 'admin'){
  echo "test1";
}
  else{
    echo "help me";
}

?>

but no luck

Link to comment
https://forums.phpfreaks.com/topic/116510-im-trying/#findComment-599164
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.