hi , ive made a member profile page and i want to grab the member data from the mysql table and display it on the page. i want to grab the data from the row associated with the member logged in. thanks.
Details of database table? Please let me know the information stored int eh table. A Export of the tables rows will help. then I can generate the mysql query and show how you can pull the data..
something like this: $username=''; // comes from some post (needs to be sanitized) $password=''; // comes from some post (needs to be sanitized) ... ... $user_query = mysql_query("select * from users where username='".$username."' AND password='".$password."';"); if (!mysql_num_rows($users_query)) { $error = true; // nobody with this username or password doesn't match (is better not to tell the right error to users) } else { $user_data = mysql_fetch_array($user_query); } if (!$error) { echo $user_data['username']; echo $user_data['address']; ... ... } else { echo '<p>Username or password doesn\'t match</p>'; ... ... }
You need to have a name of database, then connect to database. Then select a row, then display the result.