NameSilo

PHP/MySQL programming?

Spaceship Spaceship
Watch

sonjeriff

New Member
Impact
0
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.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
Well, it would depend on the structure of your database and how you're getting the member's id and/or username (however you check if they're logged in).
 
0
•••
Maybe looking into arraying the row that is assigned to the user logged in?
 
0
•••
you need a function to grab a id of the profile such as:

$id=$_GET['id'];

then a WHERE clause in your SQL statement, something like:

SELECT * FROM members WHERE id = '$id'

Something along those lines
 
0
•••
Looks like the OP has found a solution to their database problem.
 
0
•••
you need a function to grab a id of the profile such as:

$id=$_GET['id'];

then a WHERE clause in your SQL statement, something like:

SELECT * FROM members WHERE id = '$id'

Something along those lines

This is exaaclty right. However, you will need to know what user is logged in in the first place and there are several ways to do that. id will = the user id assigned in you web page to the currently loged on user.
 
0
•••
also it depends on the structure of the db. i think BollDog has come up with the solution.
 
0
•••
you need a function to grab a id of the profile such as:

$id=$_GET['id'];

then a WHERE clause in your SQL statement, something like:

SELECT * FROM members WHERE id = '$id'

Something along those lines


Make sure you use something like PDO or mysql_escape_string when using raw user input. You don't want to be dealing with SQL Injections.
 
0
•••
Appraise.net

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back