- Impact
- 23
Hi Folks,
I know this is pretty basic, but I can't seem to work it out
Not really done any MySQL programming before.
Basically all it needs to do is increase a number held in a table by one, at the moment I have :
'test' is the table.
$unid is passed into the page.
It reads the value for intraffic correctly and $traffic is incremented, but does not write the new value to the database.
I know it is probably something really basic I am missing, but have searched the net without finding anything.
Hope someone can help
All the best.
Richard
I know this is pretty basic, but I can't seem to work it out
Basically all it needs to do is increase a number held in a table by one, at the moment I have :
Code:
$db = mysql_connect("localhost", "bargaintraffic", "password here");
mysql_select_db("bargaintraffic",$db);
$result = mysql_query("SELECT * FROM test",$db);
$traffic = mysql_result($result,$unid,"intraffic");
$traffic ++;
$sql = "UPDATE test SET intraffic = '$traffic' WHERE id = $unid";
'test' is the table.
$unid is passed into the page.
It reads the value for intraffic correctly and $traffic is incremented, but does not write the new value to the database.
I know it is probably something really basic I am missing, but have searched the net without finding anything.
Hope someone can help
All the best.
Richard






