elmas156 Posted August 24, 2008 Share Posted August 24, 2008 Hello everyone, This question seems to me like it would be pretty basic but I haven't found the way to do it, maybe I'm looking in the wrong places... Anyway, I'm trying to select from a database a certain piece of information and display it on the page. For example: After a user has signed up and logged in to the website, I want to select "username" from "users table" where "email" = $email. The problem I'm having is trying to make "username" into a variable so that I can display it on the page to say something like: "Welcome $username". I've gone over the database tutorial on here but I didn't see anywhere that it covered taking a single field from a table and turning it into a variable. Any suggestions? Thanks for your help. Link to comment https://forums.phpfreaks.com/topic/121119-basic-question/ Share on other sites More sharing options...
Barand Posted August 24, 2008 Share Posted August 24, 2008 Several ways www.php.net/mysql_fetch_row www.php.net/mysql_fetch_assoc www.php.net/mysql_fetch_array www.php.net/mysql_fetch_object www.php.net/mysql_result Link to comment https://forums.phpfreaks.com/topic/121119-basic-question/#findComment-624409 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.