Jump to content

rebuilding a database


dominicd

Recommended Posts

i have a script i am using and need to rebuild the database from a source file and im having trouble creating all the proper fields below is a sample of the code but what is the easiest way to build the database with out the installer or .db file

function escape($data)
{
    if (ini_get('magic_quotes_gpc'))
{
    	$data = stripslashes($data);
    }
    return mysql_real_escape_string($data);
}

function insert_get_categories($a)
{
    global $config,$conn;
$query = "select * from categories order by name asc"; 
$results = $conn->execute($query);
$returnthis = $results->getrows();
return $returnthis;
}

function insert_get_advertisement($var)
{
        global $conn;
        $query="SELECT code FROM advertisements WHERE AID='".mysql_real_escape_string($var[AID])."' AND active='1' limit 1";
        $executequery=$conn->execute($query);
        $getad = $executequery->fields[code];
	echo strip_mq_gpc($getad);
}

function verify_login_admin()
{
        global $config,$conn;
        if($_SESSION['ADMINID'] != "" && is_numeric($_SESSION['ADMINID']) && $_SESSION['ADMINUSERNAME'] != "" && $_SESSION['ADMINPASSWORD'] != "")
        {
		$query="SELECT * FROM administrators WHERE username='".mysql_real_escape_string($_SESSION['ADMINUSERNAME'])."' AND password='".mysql_real_escape_string($_SESSION['ADMINPASSWORD'])."' AND ADMINID='".mysql_real_escape_string($_SESSION['ADMINID'])."'";
        	$executequery=$conn->execute($query);

[/code]

Link to comment
https://forums.phpfreaks.com/topic/186936-rebuilding-a-database/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.