Hi all, so I'm looking to make a social network style site, just to help me understand php so please don't say anything about reinventing the wheel.
I'm looking for a way that when a user clicks on a name in the member list that it sends them to profile.php?id= so that profile.php can use it to identify whose profile they are looking for and can load the data for the profile from a mysql table.
member list
<?php
mysql_connect("localhost", "root", "") or die (mysql_error());
mysql_select_db ("phplogin");
$result = mysql_query ("SELECT * FROM users WHERE username=enzo");
@$row = mysql_fetch_array($result);
$id = $row['id'];
echo '<a href="profile.php?id="$id">Enzo's Profile</a>';
?>
profile
$currentprofile = $_GET ['id'];
mysql_connect("localhost", "root", "") or die (mysql_error());
mysql_select_db ("phplogin");
$result = mysql_query ("SELECT * FROM users WHERE id=$currentprofile");
@$row = mysql_fetch_array($result);
echo $row['profileinfo'];
is it wise to keep the profile info and "about me" user input text in a mysql table?
someone needs to write a decent tutorial on profiles that are user editable, people want to try recreate facebook/myspace to see how it works, its not about reinventing anything.
thanks, enzo