I need a simple help .. i am new in php .. i know how to put data from a form through php page to database .. but now my problem is if the data is put again it get overwrite.. So how can i keep the old data and show it as a new data are added ... like if i put in the form 10 and next time put 30 it will show me 40 but now it show 30 only please help
Give your script please Dont see the problem. Just det information from DB (SELECT), save it in variable, get information from form and add it to saved variable, update your DB
i dont have script i am making a singel php file for it .. the way you say is sound nice .. i will try if it dont work i will give the php file i make
You're probably not adding ID to your database with the auto_update .. so its probably overwriting it.
For example <?php $con = mysql_connect("localhost","qwerty","qwerty"); mysql_select_db("yourDB", $con); $someNumber=$_REQUEST['number']; // number you want to update $result = mysql_query("SELECT someNumber FROM someTable WHERE id=111"); while($row = mysql_fetch_array($result)) { $someNumberFromDB = $row['someNumber']; } $someNumber+=$someNumberFromDB; mysql_query("UPDATE someTable SET someNumber = $someNumber WHERE id=111"); mysql_close($con); ?> PHP: