hello everyone I would like to ask how to update a database using the php script. Below is the code that I used for updating but for some reasons it does not seem to work. Can you guys help me? Thank you very much my friends.
<?php
$h = 'localhost';
$u = 'root';
$p = 'password';
$db = 'webcontents';
$id = 1;
$hits = 5;
$dbc = mysql_connect($h,$u,$p) or die('could not connect to database');
$dbz = mysql_select_db($db);
$query = 'update webcontents set hits='.$hits.'where webid='.$id;
$result = mysql_query($query);
?>