Send multiple ID's in a link?
Posted: Wed Sep 30, 2009 10:17 am
Hey gurus, i got a little problem
When a user clicks a link they are taken to a new page "proofprocess.php" on this page is various queries what change user values, i got the id of that user by making the link "proofprocess.php?id=$userproof_id" and then useing $id.... so this page with the queries looks like this:
now i edited the code to show you where i am stuck, i need to select another ID not the users id but the jobs id, how can i get this information when the only id i have used has traveled in the link? The id of the job is on the page before it i just dont know how to send it to the process page. Any help is much apreicated
When a user clicks a link they are taken to a new page "proofprocess.php" on this page is various queries what change user values, i got the id of that user by making the link "proofprocess.php?id=$userproof_id" and then useing $id.... so this page with the queries looks like this:
Code: Select all
<?
$sql = "SELECT `proof`.*,
`users`.*
FROM `proof`,`users`
WHERE users.id = $id
AND proof.userproof_id = $id
AND proof.job_id = ?????"; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< STUCK
$result = mysql_query($sql)
or die('Invalid query: ' . $sql . ' - Error is ' . mysql_error());
$sql = "UPDATE `users`,`proof`
SET clickstatus = 1
WHERE proof.userproof_id = $id";
$result = mysql_query($sql)
or die('Invalid query: ' . $sql . ' - Error is ' . mysql_error());
$sql = "UPDATE `users`,`proof`
SET user_money = user_money + perperson
WHERE users.id = $id";
$result = mysql_query($sql)
or die('Invalid query: ' . $sql . ' - Error is ' . mysql_error());
$sql = "UPDATE `users`
SET jobs_completed = jobs_completed + 1
WHERE id = $id";
$result = mysql_query($sql)
or die('Invalid query: ' . $sql . ' - Error is ' . mysql_error());
?>