Jump to content


Photo

database/site confusion


  • Please log in to reply
1 reply to this topic

#1 dirty_student

dirty_student
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 10 March 2006 - 03:49 PM

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

#2 keeB

keeB
  • Staff Alumni
  • Advanced Member
  • 1,078 posts
  • LocationCalifornia

Posted 10 March 2006 - 05:03 PM

[!--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) View Post[/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..

<?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);

?>

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


Come visit my site to see my latest projects
http://nick.stinemates.org/wordpress/





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users