DBdebug) $this->ADODB->debug = true; $this->dbh = mysql_connect($this->DBhost, $this->DBuser, $this->DBpass); mysql_select_db($this->DBname, $this->dbh); $this->dbgtxt = ''; } function __destruct() { mysql_close($this->dbh); } function simpleQuery ($table,$fields = "",$where = "", $extra = "") { if($where) $where = "WHERE ".$where; if ($fields == "*" || $fields == ""){ $fieldsArray = $this->getFields($table); $fields = '`' .implode("`,`",$fieldsArray). '`'; } $query = "SELECT $fields FROM $table $where $extra"; $this->dbgtxt .= $query."\n"; $dh = mysql_query($query, $this->dbh); $data = array(); if(is_resource($dh)){ while($datal = mysql_fetch_assoc($dh)){ $data[] = $datal; } mysql_free_result($dh); } $this->totalQueries++; // let's make sure that we have data to return, or else return false if(count($data) > 0) { return $data; } else { return false; } } function dbWrite($table,$pairs,$where = "") { if($where) $where = "WHERE ".$where; $nPairs = count($pairs); for ($i=0;$i<$nPairs;$i++) { $keys .= "`".key($pairs)."`"; $values .= "'".$this->escape($pairs[key($pairs)])."'"; if ($i<($nPairs -1)) { $keys .= ","; $values .= ","; } next($pairs); } $query = "INSERT INTO $table ($keys) VALUES ($values) $where"; $this->dbgtxt .= $query."\n"; mysql_query($query,$this->dbh); $this->totalQueries++; return mysql_insert_id($this->dbh); } function dbBatchWrite($table,$arrs,$where = "") { if($where) $where = "WHERE ".$where; $numr = count($arrs); $i=0; foreach($arrs as $pairs){ if($i==0){ $i++; $keys = "`".implode('`,`',array_keys($pairs))."`"; $values = "("; }else{ $values.=",("; } foreach($keys as $aky){ $values .= "'".$pairs[$aky]."'"; } $values.=")"; } $query = "INSERT INTO $table ($keys) VALUES $values $where"; $this->dbgtxt .= $query."\n"; mysql_query($query,$this->dbh); $this->totalQueries++; return mysql_insert_id($this->dbh); } function dbReplace($table,$pairs,$where = "") { if($where) $where = "WHERE ".$where; $nPairs = count($pairs); for ($i=0;$i<$nPairs;$i++) { $keys .= "`".key($pairs)."`"; $values .= "'".$pairs[key($pairs)]."'"; if ($i<($nPairs -1)) { $keys .= ","; $values .= ","; } next($pairs); } $query = "REPLACE INTO $table ($keys) VALUES ($values) $where"; $this->dbgtxt .= $query."\n"; mysql_query($query,$this->dbh); $this->totalQueries++; return mysql_insert_id($this->dbh); } // this function does a INSERT... SELECT - it also works a lil bit differently than the other funcs //function dbInsertSelect($insTable,$insFields,$selTable,$selFields,$selWhere,$selExtra) function dbInsertSelect($data) { if($data['selWhere']) $data['selWhere'] = "WHERE ".$data['selWhere']; if ($data['insFields'] == "*" || $data['insFields'] == ""){ $data['insFieldsArray'] = $this->getFields($data['insTable']); $data['insFields'] = implode(",",$data['insFieldsArray']); } if ($data['selFields'] == "*" || $data['selFields'] == ""){ $data['selFieldsArray'] = $this->getFields($data['selTable']); $data['selFields'] = implode(",",$data['selFieldsArray']); } $query = "INSERT INTO ".$data['insTable']." (".$data['insFields'].") SELECT ".$data['selFields']." FROM ".$data['selTable']." ".$data['selWhere']." ".$data['selExtra']; $this->dbgtxt .= $query."\n"; mysql_query($query,$this->dbh); $this->totalQueries++; $ar = mysql_affected_rows($this->dbh); if($ar >= 1) return $ar; else return false; } function dbUpdate($table,$pairs,$where,$type) { if($where) $where = "WHERE ".$where; // let's check to see whether or not the pairs var is an array if(is_array($pairs)) { $nPairs = count($pairs); for ($i=0;$i<$nPairs;$i++) { if(!$type) $update .= "`".key($pairs)."`='".$this->escape($pairs[key($pairs)])."'"; else $update .= "`".key($pairs)."`=".$this->DB->escape($pairs[key($pairs)]); if ($i<($nPairs -1)) $update .= ","; next($pairs); } } else $update = $pairs; $query = "UPDATE $table SET $update $where"; $this->dbgtxt .= $query."\n"; mysql_query($query,$this->dbh); $this->totalQueries++; $ar = mysql_affected_rows($this->dbh); if($ar >= 1) return $ar; else return false; } function delete($table,$where, $extra = "") { $query = "DELETE FROM $table WHERE $where $extra"; $this->dbgtxt .= $query."\n"; mysql_query($query,$this->dbh); $this->totalQueries++; $ar = mysql_affected_rows($this->dbh); if($ar >= 1) return $ar; else return false; } function getFields($ftable) { $fquery = "SHOW COLUMNS FROM $ftable"; $this->dbgtxt .= $fquery."\n"; $fdh = mysql_query($fquery,$this->dbh); $retfields = array(); while($fdt = mysql_fetch_assoc($fdh)){ $retfields[] = $fdt['Field']; } mysql_free_result($fdh); $this->dbgtxt .= "SHOW COLUMNS returned : ".implode(',',$retfields)."\n"; return $retfields; } function escape($ips) { return mysql_real_escape_string($ips,$this->dbh); } } VCARS - Home
Ventura County
Amateur Radio Society
Meeting Info Technical Projects
Member List Weak Signal
Event Pictures Links
Tools Members Only
VCARS events N6R 15th year



Amateur Radio
News Reports
News Line
Rain Report


ARRL.org Our Next Meeting will be at the
Moorpark Chamber of Commerce Office
at 7:30 PM
See Meeting Info for detail




Field Day was a GREAT success
Thanks to the following


Ronald Reagan Library and Foundation

All Amateur Radio Operators involved

The young people with great AWE in the eyes !
The GREAT Public !

Stu Sheldon our PIO officer

Frank Valdez our Chief Cook

Rick Slater and Steve Curtis
for the wireless logging
infrastructure

N1MM software

All the Band Captains
Which without we could not have
made this possible

And finally

Vern Potter

for his tireless work
on all the details it takes to run a
successful
Field day

Bob Paull
KK6UE
Safety officer 2016 Field Day

(anyone ready for next year)







 
WebMaster
.