dirty_student Posted March 10, 2006 Share Posted March 10, 2006 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 More sharing options...
keeB Posted March 10, 2006 Share Posted March 10, 2006 [!--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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.