lester2222 Posted April 5, 2006 Share Posted April 5, 2006 Well.. ryt now im working with a WAP site.Here's my site. [a href=\"http://www.wapthesis-ml.net\" target=\"_blank\"]WAPTHESIS[/a].Ok here's the scenario, after a successful login, the user will prompt to choosePRELIM MIDTERM and FINALS. I want to display the Data from DATABASE(Name,year_level,etc..) of that user who just made a successful login, what i meannot all the DATA in the database just for the user who made i successful login. Im Really stuck ryt now..Hope someone help a Noob like me.Thanks! Link to comment https://forums.phpfreaks.com/topic/6687-getting-data-from-mysql-w-validation/ Share on other sites More sharing options...
AV1611 Posted April 5, 2006 Share Posted April 5, 2006 can I suggest you show us your login script so we can have a clue what the problem is? Link to comment https://forums.phpfreaks.com/topic/6687-getting-data-from-mysql-w-validation/#findComment-24291 Share on other sites More sharing options...
lester2222 Posted April 5, 2006 Author Share Posted April 5, 2006 [code]<?PHP//convert the field values to simple variables$username = $_POST['username'];$password = $_POST['password'];//set the database connection variables$dbHost = "localhost";$dbUser = "";$dbPass = "";$dbDatabase = "wpthes_mobilegrades";//connect to the database$db = mysql_connect("$dbHost", "$dbUser", "$dbPass") or die ("Error connecting to database.");mysql_select_db("$dbDatabase", $db) or die ("Couldn't select the database.");$result=mysql_query("select login_id from login where username='$username' AND password='$password'", $db);//check that at least one row was returned$rowCheck = mysql_num_rows($result);if($rowCheck > 0){while($row = mysql_fetch_array($result)){ //successful login code will go here... header("Location: period.php"); } } else { //if nothing is returned by the query, unsuccessful login code goes here... echo 'Incorrect login name or password. Please try again.'; } ?> [/code] Link to comment https://forums.phpfreaks.com/topic/6687-getting-data-from-mysql-w-validation/#findComment-24310 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.