On Tue, 14 Aug 2001, Kit Kerbel wrote:

> This is a sample of my table.
> 
> how would i go about checking the user type after I have verified that the 
> user exists in the table?  I tried this query:
> // Determine User Type For Redirection
>     $redirect = "SELECT UserType FROM User WHERE
>              BearID = '$PHP_AUTH_USER' AND
>              SSN = '$PHP_AUTH_PW'";
> // Execute query to set User Type variable
>     $type = mysql_query( $redirect )
>      or die ( 'Unable to execute query.' );
> 
> what do I need to do from here?
> Any suggestions?

I believe this would be better suited in a PHP related mailing list
anyways :
$result = mysql_query( $redirect ) or die ( 'Unable to execute query.' );
$row = mysql_fetch_array($result) or die ( 'No rows found.');
if ($row["UserType"] == "Student")
        // redirect for student
else
        // redirect for others

for mysql, check :
http://www.php.net/manual/en/ref.mysql.php
http://www.php.net/manual/en/function.mysql-fetch-array.php

and for the redirect :
http://www.php.net/manual/en/function.header.php



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to