one time insert and other time update code example
Example: one time insert and other time update
$sql = "INSERT INTO " .PHOTOS_TABLE. "
(
photo_name,
photo_date,
photo_proper,
photo_size,
album_id
)
VALUES
(
'" .addslashes($photo_name). "',
" .time(). ",
'" .addslashes($key_name). "',
" .intval($size). ",
" .$album. "
)";
$update_query="UPDATE albums set count=count+'1' where condition"; // total will be updated to total+number of new puppies added.
mysql_query($update_query);