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
https://forums.phpfreaks.com/topic/4611-databasesite-confusion/
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
https://forums.phpfreaks.com/topic/4611-databasesite-confusion/#findComment-16165
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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