Click here to join us on IRC (#charas on irc.freenode.net)!
-- Table structure for table `test_table`--CREATE TABLE IF NOT EXISTS `test_table` ( `ID` int(11) NOT NULL AUTO_INCREMENT, `test` text COLLATE latin1_general_ci NOT NULL, PRIMARY KEY (`ID`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
<html><head> <title>Installation of YourApp</title></head><body><?php//Script developed by loftyD. Please credit him!!!$sub = $_POST['sub'] ;$loc = $_POST['svr'] ;$user = $_POST['mysql_user'] ;$pass = $_POST['mysql_pass'] ;$db = $_POST['mysql_db'] ;if(isset($sub)) {$con = mysql_connect($loc,$user,$pass) or die("Sorry invalid username or password.<br>");$sel_db= mysql_select_db($db,$con) or die("Sorry database invalid or has not been created.<br>");if($sel_db) {$sqlFileToExecute = 'install.sql' ;$newconnect = "<?php \$connect = mysql_connect('$loc', '$user', '$pass') ; $\db_selected = mysql_select_db($db, \$connect); ?> " ;strip_tags($newconnect) ; if ($conn !== false){ // Load and explode the sql file $f = fopen($sqlFileToExecute,"r+"); $sqlFile = fread($f,filesize($sqlFileToExecute)); $sqlArray = explode(';',$sqlFile); //Process the sql file by statements foreach ($sqlArray as $stmt) { if (strlen($stmt)>3){ $result = mysql_query($stmt); if (!$result){ $sqlErrorCode = mysql_errno(); $sqlErrorText = mysql_error(); $sqlStmt = $stmt; break; } } } } $makefile = fopen('connect.php','w+') ; fwrite($makefile,$newconnect) ; echo "Database and SQL code successfully installed. Now delete this file immediately!" ; exit; }}?><form action="<?PHP $_SERVER['PHP_SELF' ] ; ?>" method="POST">MySQL Server (localhost should be fine): <input type="text" name="svr"><Br>MySQL Username: <input type="text" name="mysql_user"><Br>MySQL Password: <input type="password" name="mysql_pass"><Br>MySQL Database (Please create before installing!) : <input type="text" name="mysql_db"><Br><input type="submit" name="sub" value="Submit"></form></body></html>