Location: PHPKode > projects > PHP MySQL Address Book > addressbook/library/qrymngr.php
<?php

class phpqrymngr
{
var $sql;
var $tablename;
var $connection;
var $databaseName;
var $redirect;
var $db;
function runquery(){
                $this->databaseName ="addrnew";
			    $this->connection = mysql_connect("localhost","root","");
				if (!$this->connection)
				  {
					  die('Could not connect: ' . mysql_error());
				  }
			       // or die ("Error while connecting to localhost");
			    $this->db = mysql_select_db($this->databaseName,$this->connection);
		        //or die ("Error while connecting to database");
				if (!mysql_query($this->sql,$this->connection))
					  {
						  die('Error: ' . mysql_error());
					  }
			   mysql_close($this->connection);
			   //echo "1 record added don wen get is 0";
		  	//header('Location: '.$this->redirect);
			exit;
        }
}
?>
Return current item: PHP MySQL Address Book