1$sql = "INSERT INTO " .PHOTOS_TABLE. "
2 (
3 photo_name,
4 photo_date,
5 photo_proper,
6 photo_size,
7 album_id
8 )
9 VALUES
10 (
11 '" .addslashes($photo_name). "',
12 " .time(). ",
13 '" .addslashes($key_name). "',
14 " .intval($size). ",
15 " .$album. "
16 )";
17
18
19$update_query="UPDATE albums set count=count+'1' where condition"; // total will be updated to total+number of new puppies added.
20
21mysql_query($update_query);
22