ambo Posted September 17, 2008 Share Posted September 17, 2008 I need help calling data from table for userid so when they login there profile has a gender Name Email i have the table information de_user ( email , sex , name) Link to comment https://forums.phpfreaks.com/topic/124573-solved-help-calling-data-from-table/ Share on other sites More sharing options...
genericnumber1 Posted September 17, 2008 Share Posted September 17, 2008 you need to have an auto_increment int column userid... add one. After that, $someUserId = 23523; $query = "SELECT * FROM de_user WHERE userid = '$someUserId'"; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_assoc($result); echo "{$row['email']}<br />{$row['name']}<br />{$row['sex']}"; Link to comment https://forums.phpfreaks.com/topic/124573-solved-help-calling-data-from-table/#findComment-643427 Share on other sites More sharing options...
ambo Posted September 17, 2008 Author Share Posted September 17, 2008 Thanks that worked i used $someUserId = $session[userid]; Link to comment https://forums.phpfreaks.com/topic/124573-solved-help-calling-data-from-table/#findComment-643431 Share on other sites More sharing options...
genericnumber1 Posted September 17, 2008 Share Posted September 17, 2008 You might want to clarify the variable name, I did that as an example. And don't just copy the code! Figure out how it works! Link to comment https://forums.phpfreaks.com/topic/124573-solved-help-calling-data-from-table/#findComment-643445 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.