Justa Lol
Feb 18th, 2010, 06:14 AM
i'm making a project where people can click on others links and well when this is clicked i want it to go to the next user thats in the 'users' table(not clicks) and well, the current user would be the receiver, now what i need is to find the user that comes after $receiver in the users table
if (isset($_POST['sendclick'])) {
$currentweek = date("W", time());
$clickresult = mysql_real_escape_string($_POST['clickresult']);
$username = mysql_real_escape_string($_POST['username']);
$receiver = mysql_real_escape_string($_POST['receiver']);
if (!($username == "(Choose Username)")) {
mysql_query("INSERT INTO clicks (clicker, receiver, week, message) VALUES ('".$username."', '".$receiver."', '".$currentweek."', '".$clickresult."')");
/*
$nextuser will be the user after the current $receiver.
what i need is to select all from users and get the next user on the list...
header("Location: index.php?view=recruit&click=$nextuser");
*/
}
}
i put a comment in the code so i could make a bit more sense, and if this doesn't make any sense at all or almost no sense, please ask...
if (isset($_POST['sendclick'])) {
$currentweek = date("W", time());
$clickresult = mysql_real_escape_string($_POST['clickresult']);
$username = mysql_real_escape_string($_POST['username']);
$receiver = mysql_real_escape_string($_POST['receiver']);
if (!($username == "(Choose Username)")) {
mysql_query("INSERT INTO clicks (clicker, receiver, week, message) VALUES ('".$username."', '".$receiver."', '".$currentweek."', '".$clickresult."')");
/*
$nextuser will be the user after the current $receiver.
what i need is to select all from users and get the next user on the list...
header("Location: index.php?view=recruit&click=$nextuser");
*/
}
}
i put a comment in the code so i could make a bit more sense, and if this doesn't make any sense at all or almost no sense, please ask...