Posts by pulsevortex
I am working on a PHP/MySQL resource booking system for a school. Heh.
pulsevortex
Newbie Poster
2 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
You need to add a 'WHERE' clause in your statement. For example:
$upd="update news set title='$_POST[title]',date='$_POST[date]',post='$_POST[post]' WHERE id = '$_POST[id]'";
This assumes that there is a hidden field in your form that has the unique value of the entry you are editing.
Edit:
I should also add that it is bad practice to execute sql statements without sanitising the inputs.
pulsevortex
Newbie Poster
2 posts since Dec 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0
© 2013 DaniWeb® LLC
Page rendered in 0.0351 seconds
using 2.45MB