hello!
Here is what i'm having problems with:
I need to write a user access query that will go into my database, view a field, and depending on the result forward the user to one of four html pages (forms).
I have the username/password table setup, however I'm having a problem with the query dependencies, returning the value, and then forwarding to a dependent html form.
Can anybody offer me any assistance?
-Michael
sql query problem
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
definately. I'm sorry about that. I am new to this.
I think i might have simplified it a bit.
What i need to work on is a php/sql script that will query a database and verify a username/password. Then it will return a Category field of this username/password. Depending on that field, i need to write a series of IF statements which will forward to an html page.
Does this seem like the most effective way to accomplish this?
THANKS,
-michael
I think i might have simplified it a bit.
What i need to work on is a php/sql script that will query a database and verify a username/password. Then it will return a Category field of this username/password. Depending on that field, i need to write a series of IF statements which will forward to an html page.
Does this seem like the most effective way to accomplish this?
THANKS,
-michael
sql issue
Here is what I cannot get to return properly.
I am trying to return the value of the 4th column (category) which corresponds to the username given.
---------------------------------------------------------------
$query="SELECT category FROM users WHERE username='$username'";
$result=mysql_query($query);
echo $result;
---------------------------------------------------------------
The output is simply: Resource id #4
How can i get it to return the value of field 4 corresponding to the given $username (defined during login)?
THANKS
-michael
I am trying to return the value of the 4th column (category) which corresponds to the username given.
---------------------------------------------------------------
$query="SELECT category FROM users WHERE username='$username'";
$result=mysql_query($query);
echo $result;
---------------------------------------------------------------
The output is simply: Resource id #4
How can i get it to return the value of field 4 corresponding to the given $username (defined during login)?
THANKS
-michael
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
You can't directly echo the result of a mysql_query() call, have a look at:
http://www.php.net/manual/en/ref.mysql. ... l.examples
Mac
http://www.php.net/manual/en/ref.mysql. ... l.examples
Mac