Can anyone please explain the use of '$Buffer' in this following code and the use of 'global $tbl_ads;' ... and if this will work in a PHP4.2 'register_globals off' environment?
Thank you.
=====================
function update_ads ($data) {
global $tbl_ads;
$buffer=mysql_query("SELECT DATE_ADD(current_date(), INTERVAL ".$data[duration]." DAY)") or die("update_ads".mysql_error());
$enddate=mysql_result($buffer, 0);
$query ="UPDATE $tbl_ads SET ";
$query.="category=$data[category], name='$data[name]',
email='$data[email]', homepage='$data[homepage]', ";
$query.="phone='$data[phone]', showphone='$data[showphone]', city='$data[city]', ";
$query.="subject='$data[subject]', message='$data[message]',
enddate='$enddate', duration=$data[duration], modifydate=NOW('') ";
$query.="WHERE ads_id=$data[ads_id]";
$hasil=mysql_query($query) or die("gagal update");
return $data[ads_id];
}