Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Kaip atnaujinti DB su tokiu failu?

Parašė scdogas321· 2013 Sau. 5 20:01:02
#5

Kodas:


<?php
# 
#
# DB update
# 
#
require_once "maincore.php";
 
$result = dbquery("DROP TABLE IF EXISTS ".$db_prefix."reputation_settings");
$result = dbquery("CREATE TABLE IF NOT EXISTS ".$db_prefix."reputation_settings (
		max_posts SMALLINT(5) unsigned NOT NULL default '1',
		max_post_adm SMALLINT(5) unsigned NOT NULL default '1',
		max_post_sadm SMALLINT(5) unsigned NOT NULL default '1',
		discription SMALLINT(1) unsigned NOT NULL default '1'
	) TYPE = MyISAM;");
if ($result) {
	echo "DB atnaujinta";
	$result = dbquery("
						INSERT INTO 
							".$db_prefix."reputation_settings 
							(max_posts,max_post_adm,max_post_sadm,discription) 
						VALUES 
							('1','1','1','1')"
					);
} else {
	echo "iviko klaida";
}
 
 
 
?>




Bandau reputacijos moda isirasyti :)