hi coding help geting a row form sql then printing
Posted: Mon Apr 03, 2006 12:45 pm
hi
where it says get user id i need it to get the value of priv from my table from the same row as the user like the get user id that finds form username to get the row the problem is wher i have writen in caps down below i want the value of priv to be the url it goes to (in priv i have the urls set up for each user)
sorry if i have worded this badly it was hard to explain
thanks in advance
reece
where it says get user id i need it to get the value of priv from my table from the same row as the user like the get user id that finds form username to get the row the problem is wher i have writen in caps down below i want the value of priv to be the url it goes to (in priv i have the urls set up for each user)
Code: Select all
// get users id
$getid = "SELECT * FROM $dbtable WHERE username='".$user."' LIMIT 1";
$getidexec = mysql_query($getid);
while($r=mysql_fetch_array($getidexec)){
$userid = $r[userid];
}
// set a cookie
setcookie("userid", "$userid", time()+3600, "/", "", 0 );
echo "You have successfuly loged in! Welcome, $user .<br><br><a href=\"(THIS SHOULD LINK TO A URL THE URL IS IN THE DATABASE on a row called priv i want it to find that and then it would be put here si it would go to it \">Continue...</a>";thanks in advance
reece