irm-1.6-b3/lib/IRMDB.php
/** Create an insert query and run it on the database.
	 * Similar in concept to the autoExecute method in PEAR::DB --
	 * take an assoc. array of field => value pairs in $values, and create
	 * an INSERT INTO $table query from that.
	 */
Create an insert query and run it on the database.
Similar in concept to the autoExecute method in PEAR::DB
take an assoc. array of field => value pairs in $values, and create
an INSERT INTO $table query from that.
Create an insert query and run it on the database . Similar in concept to the autoExecute method in PEAR :: DB take an assoc . array of field = > value pairs in $values and create an INSERT INTO $table query from that .
function InsertQuery($table, $values)
	{
		$fields = array();
		$quoted = array();
		foreach ($values as $f => $v)
		{
			$fields[] = $f;
			$quoted[] = $this->_dbh->getTextValue($v);
		}
		$fields = join(',', $fields);
		$quoted = join(',', $quoted);
		$q = "INSERT INTO $table ($fields) VALUES ($quoted)";
		$this->query($q);
	}
function InsertQuery ( $ table , $ values ) { $ fields = array ( ) ; $ quoted = array ( ) ; foreach ( $ values as $ f => $ v ) { $ fields [ ] = $ f ; $ quoted [ ] = $ this -> _dbh -> getTextValue ( $ v ) ; } $ fields = join ( ',' , $ fields ) ; $ quoted = join ( ',' , $ quoted ) ; $ q = " INSERT INTO  $ table  ( $ fields ) VALUES ( $ quoted ) " ; $ this -> query ( $ q ) ; }
Create an insert query and run it on the database.
Create an insert query and run it on the database .
// The list of fields in the insert query // The quoted values ready for insertion