Jump to content

djmelle

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

djmelle's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hi, yep when I echo the id in the formular (the red) I have the right id print "<tr><td><b>id:</b> <input type='hidden' name='accid' value='$n1[id]'>$n1[id]</td>"; but when I send it to update the script it always the last id, I've tried to echo here before updating the databas and it always gives me the last id...
  2. Hi! I've made a script which gets posts from a database which needs to be accepted before it's put on the site. but when I try to update a post on the admin page I've made some kind of mistake since it always update the last id in the database thats need to be accepted and not the actual one you click on. here's the full code: <?php include("header.php"); ?> <?php if(isset($_POST['acc'])) { $accid = $_POST['accid']; $update=mysql_query("update fansaker set acc='1' where 'id'='$accid'"); } ?> <?php $adminsql=mysql_query("select * from fansaker where acc = 0 order by id"); print "<table border='0' width='400' cellspacing='0' cellpadding='0' align=center>"; print "<form name=acc' method='post' action='acc.php'>"; while($n1=mysql_fetch_array($adminsql)){ print "<tr><td><b>id:</b> <input type='hidden' name='accid' value='$n1[id]'>$n1[id]</td>"; print "<tr bgcolor=#f1f1f1><td colspan=2>$n1[comment] <b>FTML</b></td></tr>"; print "<tr><td><input type='submit' name='acc' value='accept'> <input type='submit' name='del' value='delete'></td></tr>"; } print "</table>"; ?> any help would be appreciated!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.