agapitos Posted May 24, 2012 Share Posted May 24, 2012 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()); ?> Link to comment https://forums.phpfreaks.com/topic/263035-having-multiple-sql-queries-dependant-of-what-type-of-user-logs-in/ Share on other sites More sharing options...
agapitos Posted May 24, 2012 Author Share Posted May 24, 2012 this is the error code i keep getting. Parse error: syntax error, unexpected $end Link to comment https://forums.phpfreaks.com/topic/263035-having-multiple-sql-queries-dependant-of-what-type-of-user-logs-in/#findComment-1348220 Share on other sites More sharing options...
fenway Posted May 27, 2012 Share Posted May 27, 2012 First, it gives you a line number. Second, "$end" doesn't show up the code you posted. Link to comment https://forums.phpfreaks.com/topic/263035-having-multiple-sql-queries-dependant-of-what-type-of-user-logs-in/#findComment-1348956 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.