TKW22 Posted March 23, 2009 Share Posted March 23, 2009 im trying to delete stuff out of the data base using something like this. <?php while($rowy = mysql_fetch_array($result)) { echo '<tr>'; echo '<td>' . $rowy['name'] . '</td>'; echo '<td>' . $rowy['id'] . '</td>'; echo '<td>' . $rowy['email'] . '</td>'; echo '<input type="submit" value="get rid of" name="userd"/>'; echo '</tr>'; } ?> if i can do this can you tell me how?also how can i make new pages form the admin using a template I'v made? Link to comment Share on other sites More sharing options...
jlhaslip Posted March 23, 2009 Share Posted March 23, 2009 Easiest way would be to write a separate Delete script and on this page, write a link to the delete.php script using the row['id'] as an identifier to set the id to be deleted. Link to comment Share on other sites More sharing options...
TKW22 Posted March 23, 2009 Author Share Posted March 23, 2009 Easiest way would be to write a separate Delete script and on this page, write a link to the delete.php script using the row['id'] as an identifier to set the id to be deleted.is there any Tutorials on making an admin?and how would i get the info form that row to delete it? Link to comment Share on other sites More sharing options...
ProblemHelpPlease Posted March 23, 2009 Share Posted March 23, 2009 If you include a link to a new delete script, which can either be a form with a hidden field that contains the id or a http link using a GET address(like http://www.yourdomain.com/delete.php?id=123) then you can pass the row to delete to the delete script.You can then use $_REQUEST['id']; to get the id and use DELETE in mysql to delete the id row. Link to comment Share on other sites More sharing options...
TKW22 Posted March 23, 2009 Author Share Posted March 23, 2009 If you include a link to a new delete script, which can either be a form with a hidden field that contains the id or a http link using a GET address(like http://www.yourdomain.com/delete.php?id=123) then you can pass the row to delete to the delete script.You can then use $_REQUEST['id']; to get the id and use DELETE in mysql to delete the id row.thanks got it and what about making new pages using the admin and a template i made? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.