Okay, so what I need it kinda complicated. I have a for statement, that creates a number of buttons, based on a SQL table query, say there are 5 tables in the database, it will create a button for each table, and when you click it it changes a value in that table called 'pending' to 1, the tables include a 'name' value, an 'id' value, and a few other unimportant values. (here is a picture of the thing it makes for each object in the for statement) [ATTACH]4801[/ATTACH] Pretty much what I want is it to, when you click the approve or decline button, it runs this code:
mysql_query("UPDATE 'skins' SET 'pending'='1' WHERE `id`='$curid'");
The problem is, I dont know how to keep the $curid variable for each thing, its a div inside a table. no errors, but when i click the approve button, the page 'loads' and nothing happens as far as i can tell. Here is my code, as a whole so far.
<?php
//13 skins/ln
$rotations = -1;
for ($count = 1; $count <= $xA; $count ++){
$xB = mysql_fetch_array($x);
$rotations ++;
if ($rotations == (9)){
$rotations = 0;
echo '</tr><tr>';
}
?>
<td style="width: 11%; height: 160px; border-radius: 5px; background-color: #0094FF; color: white; float: left;">
<p><center><img src="/images/skins/<?php print_r($xB['skinname']); ?>" width="100" height="100" /></center>
<center> $<?php print_r($xB['price']); ?> </center></a>
<a href="Skin.php?id=<?php print_r($xB['id']); ?>">
<?php $curid = $xB['id']; ?>
<center><?php print_r($xB['Name']); ?></center></a>
<center>
<p>By: <a href="User.php?id=<?php print_r($xB['creatorId']); ?>"><?php print_r($xB['creator']); ?></a></p>
<?php if ($_POST['Approve']){ mysql_query("UPDATE 'skins' SET 'pending'='1' WHERE `id`='$curid'"); echo("done."); } ?>
<form id="form1" name="form1" method="post" action="">
<p>
<input type="submit" name="approve" id='approve' value="Approve" />
</p>
<p>
<input type="submit" name="decline" id="decline" value="Decline" /></p></form></center></td>
This is just a part of the code in the middle, so ignore any missing parts on the top or the bottom of the code snippet.
helpex.PNG