Jump to content

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


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());

?>

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.