Jump to content

database/site confusion


dirty_student

Recommended Posts

hi every1 i need help!!!!

I am creating a student management system in dreamweaver using php mysql for university and have ran into a problem. I have a log in page where a username and password is entered from the student table and then the user is taken to the next page which is where i would like to display the users name from the database but dunno how???

suggestions??? probably easy but got no clue!!

cheers

steve
Link to comment
Share on other sites

[!--quoteo(post=353641:date=Mar 10 2006, 03:49 PM:name=dirty_student)--][div class=\'quotetop\']QUOTE(dirty_student @ Mar 10 2006, 03:49 PM) [snapback]353641[/snapback][/div][div class=\'quotemain\'][!--quotec--]
hi every1 i need help!!!!

I am creating a student management system in dreamweaver using php mysql for university and have ran into a problem. I have a log in page where a username and password is entered from the student table and then the user is taken to the next page which is where i would like to display the users name from the database but dunno how???

suggestions??? probably easy but got no clue!!

cheers

steve
[/quote]


Consider this hypothetical users table..

[code]
<?php

$q = "select firstName, lastName from users where login = $_POST['login']";
$result = mysql_query($q,$conn); // $conn is the connection pointer

$username = mysql_fetch_row($result);

?>
[/code]

That would make $username[0] = user's first name, and $username[1] = user's last name..

Link to comment
Share on other sites

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.