So I'm not the best with PHP but everyone has to start somewhere.
I am wondering how I would go about taking all of the rows from a database, taking out the data from a certain column and outputting it in a certain way.
The reason I'm doing this is to make it show up with all the users registered on one page, sort of like a members page any forums would have.
I was thinking of somehow fetching the rows than putting the data into arrays than doing a foreach statement to print it out as each variable.
I'm not the best logical thinker but I will give a bit of database information below :)
This is an image of the structure of the database.
To show you guys that I am actually putting an effort into this, this is what I got so far with my terrible PHP skills ;)
$result = mysql_query("SELECT * FROM users");
while($row = mysql_fetch_array($result)) {
$username=array($row['username']);
$email=array($row['email']);
$firstname=array($row['firstname']);
$lastname=array($row['lastname']);
$motto=array($row['motto']);
$bio=array($row['bio']);
}
foreach ($username as &$item) {
print $item;
}
The one reason this code wouldn't work is because than its just selecting a row of the person with the id that is equal to $userid. This means it would grab the row info, not the column info.
Not sure how to do this as I've only done stuff with rows so far in my PHP adventure, not so much with columns :(