Install.php

Started on the old forum in December 2008 · view the original in the archive · old links redirect here

7 replies · 583 views · started 17 years ago · 1 min read

3 participants
Rider Developer · 128 posts #1

who can share me one that work

Rider Developer · 128 posts #3

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 " ";
darkdesire Senior · 250 posts #4
<?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>";

:p:p:p

darkdesire Senior · 250 posts #5

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

Rider Developer · 128 posts #6
// Dont change this code
mysql_connect("$dbhost","$dbuser","$dbpass") or die(mysql_error()); 
mysql_select_db("$dbname") or die(mysql_error());

why im always getting error here

darkdesire Senior · 250 posts #7

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

Rider Developer · 128 posts #8

Ok that could be the prob then let me check tanx darkdesire

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close