mailcode error

hii guys

I’m beginer I have one page of mailsent I want to uses this for both customer and administrator

to veiws information from the database.so what is the right way of writening a query to avoid error
because when I write this query “$result = mysqli_query($con,“SELECT * FROM mail where senderid= ‘$_SESSION[customerid]’”);”
when customer start session on login has no error but when I login as admin this error occours
//
Notice: Undefined index: customerid in C:\xampp\htdocs\design\mailisent.php on line 11

the same error occour when I change it to adminid in the customer page when its login
//

Notice: Undefined index: adminid in C:\xampp\htdocs\design\mailisent.php on line 11

please i need yoour help my code is below

//code
[php]

<?php include("header.php"); include("dbconnection.php"); ?> <? if(isset($_GET["mailid"])) { mysqli_query($con,"DELETE FROM mail where mailid='$_GET[mailid]'"); $recres = "Mail deleted Successfully..."; } $result = mysqli_query($con,"SELECT * FROM mail where senderid= '$_SESSION[customerid]'"); ?>
<div id="tem_main">

Sent Mails

<?php global $recres; echo $recres; ?> <?php echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; while($row = mysqli_fetch_array($result)) { echo " "; echo " "; echo " "; echo " "; echo " "; echo " "; } ?>
  </table>
   	  </form>

[/php]

DeleteSENDERSUBJECTTIME
Delete$row[senderid]$row[subject]$row[mdatetime]

Session variables only exists when you use the session_start function at the top of the page.

Sponsor our Newsletter | Privacy Policy | Terms of Service