Install.php
Started on the old forum in December 2008 · view the original in the archive · old links redirect here
i have this code that i can install my database files from a php file im keep on getting error on line 5 on the following code
<?php echo "<?xml version=\"1.0\"?>"; ?> <html xmlns="http://www.w3.org/1999/xhtml"> <?php $dbuser = "Database UserName"; $dbpass = "Database Password"; $dbname = "Database Name"; $dbhost = "localhost"; // Dont change this code mysql_connect("$dbhost","$dbuser","$dbpass") or die(mysql_error()); mysql_select_db("$dbname") or die(mysql_error()); { if($_POST['submit']) echo "<body>"; echo " ";?>
<html xmlns="http://www.w3.org/1999/xhtml"> <?php$dbuser = "Database User"; $dbpass = "Database Password"; $dbname = "Database Name"; $dbhost = "localhost";
// Dont change this code mysql_connect("$dbhost","$dbuser","$dbpass") or die(mysql_error()); mysql_select_db("$dbname") or die(mysql_error());
{
if($_POST['submit'])
echo "<body>";
:p:p:p
heres a basic install.php from another piece of coding, use it as a template and edit as needed mate CODE<?php
echo "<?xml version=\"1.0\"?>";
?>
<html xmlns="http://www.w3.org/1999/xhtml"> <?php$dbuser = "Database User"; $dbpass = "Database Password"; $dbname = "Database Name"; $dbhost = "localhost";
// Dont change this code mysql_connect("$dbhost","$dbuser","$dbpass") or die(mysql_error()); mysql_select_db("$dbname") or die(mysql_error());
{
if($_POST['submit'])
echo "<body>";
echo "
";
mysql_query("CREATE TABLE pet_users (
login varchar(30) NOT NULL,
password varchar(60) NOT NULL,
tamagochi varchar(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ");
mysql_query("INSERT INTO pet_users (login, password, tamagochi); ");
mysql_query("CREATE TABLE pet_tamagochi (
id int(100) NOT NULL,
name varchar(20) NOT NULL,
login varchar(20) NOT NULL,
password varchar(20) NOT NULL,
kind varchar(20) NOT NULL,
temper varchar(20) NOT NULL,
birthday varchar(20) NOT NULL,
birth_lx varchar(20) NOT NULL,
eda varchar(20) NOT NULL,
nastr varchar(20) NOT NULL,
um varchar(20) NOT NULL,
health varchar(20) NOT NULL,
toilet varchar(20) NOT NULL,
vanna varchar(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ");
mysql_query("INSERT INTO pet_tamagochi (id, name, login, password, kind, temper, birthday, birth_lx,
eda, nastr, um, health, toilet, vanna) ");
echo "click install
<form action=\"\" method=\"post\">";
echo "
"; echo "<input type="submit" value="install"/>"; echo "</form>"; echo " "; echo "</body>"; echo "</html>"; exit();
}
?>
</html>:p:p:p
because you need to create the database before you can install anything as from what you said by inbox you dont have server access to create a new database and most likely only have space for one database anyway
:p:p:p