FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Edit / Delete





DanielXP
i making a news script and i need it so i can edit or delete the news

Code:
echo "<table width='491' border='1'>
  <tr>
    <td width='395'>News Title</td>
    <td width='50'>Edit</td>
    <td width='50'>Delete</td>
  </tr>
</table>";
$getnews = mysql_query("SELECT * from news order by id DESC");
while ($news = mysql_fetch_array($getnews))
{
$id = $news[id];
echo "<table width='491' border='1'>
  <tr>
    <td width='395'>$news[title]</td>
    <td width='50'><input name='edit&id=$id' type='radio' value='radiobutton'></td>
    <td width='50'><input name='delete&id=$id' type='radio' value='radiobutton'></td>
  </tr>
</table>";
}


But i dunno how and what to do now
Ducksteina
The script you posted just reads out the news, but does not edit / delete them.
You should have a look at http://dev.mysql.com/doc/refman/5.0/en/delete.html and http://dev.mysql.com/doc/refman/5.0/en/update.html if you want to delete / edit data.
DanielXP
I know it lists the news coz if you readed it.

any way

i want it do get the news id when they click the radio and edit or delete then to go to the index.php?action=edit or delete&id= the id

if you know what i mean an i can do the rest from them
Related topics
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.