Jump to content

having multiple SQL queries dependant of what type of user logs in


agapitos

Recommended Posts

Hi im kind of having problems with this sql query. What i have is a .php form which is a log in screen that stores user accounts in a database. There are two different types of users eg. 'a', 'b'. If user 'a' logs in it redirects to a php page which conducts a sql query of type 'a' user; but when user type 'b' logs in i want it to conduct a different sql query but all on the same php page as type 'a'.

I have done something like this, but it still comes up with errors.... can someone please help me thanks.

 

<?php

 

if ($access == 'MED')

{

$sql = "SELECT application.applicationnum, application.customernum, application.applicationdate FROM application WHERE    application.applicationstatus='P' ORDER BY application.applicationdate ASC, application.applicationnum DESC";

}

else

{

$sql = "SELECT application.applicationnum, application.customernum, application.permittype, application.applicationdate FROM application WHERE application.applicationstatus !='P' ORDER BY application.applicationdate ASC";

}

 

$rs = mysql_query($sql, $conn)

or die ('Problem with query' . mysql_error());

?>

 

 

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.