Hi, I'm making a website for people to join and i created the registration, login, and logout forms and to test it i have three made up test users and for some reason whenever i log in with each of them and click on the link for their individual profile --> /profile.php?id=... page only shows the first record's information, not what user logged in...how do i fix this?? thanks!
Hi, I'm making a website for people to join and i created the registration, login, and logout forms and to test it i have three made up test users and for some reason whenever i log in with each of them and click on the link for their individual profile --> /profile.php?id=... page only shows the first record's information, not what user logged in..
It seems the userid is not passed or recieved properly.and thats why the query is always giving u the first result.
it would be better if you provide the query or the code where it is getting stucked.
ok i did that but two things: 1) should i put that in the login page and the profile page? and 2) when i did that for the login page i get this error message "Unknown column 'userid' in 'where clause'"
you need to put those 2 lines in the code which you had provided.
Basically first line will get the userid which you have passed.i.e
/profile.php?id=...
and in the query you had only done "select *" which will get you all the details of all the users.but you wanted to have details of only that user whose id is passed so put that condition
ok this is my login page's code:
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
mysql_select_db($database_SH, $SH);
$query_Recordset1 = "SELECT * FROM Signup where id = $userid";
$Recordset1 = mysql_query($query_Recordset1, $SH) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
and when i test it out, i log in and it gives me this error:
Parse error: syntax error, unexpected T_IF in /home/socialh1/public_html/home.php on line 77
line 77 is the line in the homepage's code that is under $userid = $_REQUEST['id']