Hi im quite new to PHP and currently studying it. I have trouble in loading a specific data to be called in a table under its usertype/officename for example.
Product by: [called by php]
Made by: [called by php]
I have already done this but the problem is the usertype/officename i have this code
[php]<?php
if(!isset($_SESSION))
{
session_start();
}
$user = $_SESSION[‘login’];
$server=mysql_connect(“localhost”,“root”);
if (!$server){
die (“Could not Connect”);
}
mysql_select_db(“database1”) or DIE (“No!”);
$load=mysql_query(“select * from account where officename=’$username’”);
$load2=mysql_fetch_array($load);
if ($username==$load2[‘officename’])
{
$select=mysql_query(“select madeby,requestname from makerequest where chairapproval=‘Pending’”);
$select2=mysql_fetch_array($select);
}
?>[/php]
If officename is Office1 then it must only see requests made by people under office1
imagine having 5 different offices can anyone please help me!
thank you!