login  Naam:   Wachtwoord: 
Registreer je!
 Forum

Losse Sql...

Offline SilVeX - 06/10/2005 10:45
Avatar van SilVeXHTML beginner Omdat mijn database het niet toestaat op de een of andere manier om door een install pagina de sql erin te zetten. Zou ik graag de losse sql willen van mijn cms... Maar aangezien ik er niks van snap vroeg ik me af of jullie wat met de code konden:
  1. <?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <title>Untitled Document</title>
  6. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  7. </head>
  8.  
  9. <body>
  10. <p>Thank you for downloading EliteSquadrons.</p>
  11. <p>EliteSquadrons is based off the Promisance&#8482; Enhanced Engine. This install
  12. script and system is provided &quot;as-is&quot; without warrenty and by clicking
  13. &quot;INSTALL&quot; you agree to release Kirk Fickert (aka Unimatrix) Fickert
  14. Online Media, LLC and all others involved from liablity from damages</p>
  15. <hr>
  16. <p>Okay with that out of the way lets get EliteSquadrons installed. Are you ready
  17. for this? Let's go through a simple checklist and find out!</p>
  18. <p>1. Did you read and understand the BSD licences?<br />
  19. 2. Do you know that all graphics are copyright &copy; by its designer and may
  20. <strong>ONLY</strong> be used by PERMISSION of Lorian. <br />
  21. 3. Do you have at least PHP 4.2.x installed? <br />
  22. 4. Do you have MySQL installed and ready?<br />
  23. 5. Did you edit const.php to match your server?<br />
  24. 6. Did you take a shower this morning?<br />
  25. 7. Did you remember to grab a cup of espresso before installing?<br />
  26. 8. Do you think this is getting sarcastic and out of hand?<br />
  27. 9. Do you have 5 hours a day to spend being an admin?<br />
  28. 10. Do you have your own Code Monkey named Albert to chase down bugs?</p>
  29. <p>If you answered &quot;no&quot; to one or more of the above, think twice before
  30. installing!</p>
  31. <form name="form1" id="form1" method="post" action="">
  32. <p align="center">
  33. <label>Install Password
  34. <input type="password" name="textfield" />
  35. </label>
  36. </p>
  37. <p align="center">
  38. <label>
  39. <input name="submit" type="submit" id=" submit" value="install" />
  40. </label>
  41. </p>
  42. </form>
  43. <p>&nbsp;</p>
  44. </body>
  45. </html>
  46.  
  47. <?php
  48. include('const.php') or die('damn const.php file is missing, kicking you out of the install process;');
  49.  
  50. $link = @mysql_connect($dbhost, $dbuser, $dbpass) or die('cannot find the database, captain');
  51. mysql_select_db($dbname) or die('cannot select the database');
  52.  
  53. //check the password
  54.  
  55. if ($installpwd == $textfield);
  56. {
  57. //table structure for clanforum
  58. mysql_query("CREATE TABLE '.$clanForumdb.' (
  59. num int(11) NOT NULL default '0',
  60. name text NOT NULL,
  61. PRIMARY KEY (num)
  62. )") or die('can forum db error, install aborted');
  63. //Clan threads table structure
  64. mysql_query('CREATE TABLE beta_clanthread (
  65. forum int(11) NOT NULL default '0',
  66. parent_id int(11) NOT NULL default '0',
  67. thread_id int(11) NOT NULL auto_increment,
  68. modified datetime NOT NULL default '0000-00-00 00:00:00',
  69. author text NOT NULL,
  70. title text NOT NULL,
  71. content text NOT NULL,
  72. added datetime NOT NULL default '0000-00-00 00:00:00',
  73. PRIMARY KEY (thread_id)
  74. ) TYPE=MyISAM');
  75. //fourm datastucture
  76. mysql_query('CREATE TABLE beta_forum (
  77. forum_id tinyint(4) NOT NULL auto_increment,
  78. forum_name varchar(40) NOT NULL default '',
  79. notes tinytext NOT NULL,
  80. mod tinyint(4) NOT NULL default '0',
  81. PRIMARY KEY (forum_id)
  82. ) TYPE=MyISAM');
  83. //
  84. $query = 'INSERT INTO '.$forumdb.' (forum_id, forum_name, notes, mod) VALUES (6, 'General', 'Talk about anything under the sky.', 0)';
  85. mysql_query($query);
  86. $query2 = 'INSERT INTO '.$forumdb.' (forum_id, forum_name, notes, mod) VALUES (7, 'Alliance Talk', 'Diplomacy of Alliances.', 0)';
  87. mysql_query($query2);
  88. $query3 = 'INSERT INTO '.$forumdb.' (forum_id, forum_name, notes, mod) VALUES (9, 'Bugs and Suggestions', 'Have an idea about the game that you would like to be heard?', 0)';
  89. mysql_query($query3);
  90. //forum titles stricture
  91. mysql_query('CREATE TABLE '.$titlesdb.' (
  92. `id` int(11) NOT NULL default '0',
  93. `title` text NOT NULL,
  94. PRIMARY KEY (`id`)
  95. ) TYPE=MyISAM COMMENT="table for titles"');
  96. mysql_query('INSERT INTO '.$titlesdb.' (`id`, `title`) VALUES (0, 'Normal User'),
  97. (1, 'Special User'),
  98. (2, 'Banned From Forum'),
  99. (3, 'Banned From Game'),
  100. (4, 'Forum Moderator'),
  101. (5, 'Forum Admin'),
  102. (6, 'Game Admin'),
  103. (7, 'Owner')');
  104. //clan db structure
  105. mysql_query('CREATE TABLE '.$clandb.' (
  106. num smallint(5) unsigned NOT NULL auto_increment,
  107. founder mediumint(8) unsigned NOT NULL default '0',
  108. asst mediumint(8) unsigned NOT NULL default '0',
  109. fa1 mediumint(8) unsigned NOT NULL default '0',
  110. fa2 mediumint(8) unsigned NOT NULL default '0',
  111. ally1 smallint(5) unsigned NOT NULL default '0',
  112. ally2 smallint(5) unsigned NOT NULL default '0',
  113. ally3 smallint(5) unsigned NOT NULL default '0',
  114. war1 smallint(5) unsigned NOT NULL default '0',
  115. war2 smallint(5) unsigned NOT NULL default '0',
  116. war3 smallint(5) unsigned NOT NULL default '0',
  117. pic tinytext NOT NULL,
  118. url tinytext NOT NULL,
  119. motd text NOT NULL,
  120. members smallint(6) NOT NULL default '1',
  121. name tinytext NOT NULL,
  122. tag tinytext NOT NULL,
  123. password tinytext NOT NULL,
  124. PRIMARY KEY (num)
  125. ) TYPE=MyISAM');
  126. //forum config
  127. mysql_query('CREATE TABLE '.$forumconfig.' (
  128. forum_id int(11) default '0',
  129. all_html varchar(4) default 'NO',
  130. pre varchar(4) default 'NO',
  131. links varchar(4) default 'NO',
  132. images varchar(4) default 'NO',
  133. show_ip varchar(4) default 'YES',
  134. show_info varchar(4) default 'YES',
  135. block_hosts varchar(4) default 'NO'
  136. ) TYPE=MyISAM');
  137.  
  138.  
  139.  
  140. else
  141. echo "Nice try, but the passwords do not match! Install Aborted!";
  142. }
  143.  
  144. ?>


Als iemand dit snapt zou diegene dan de losse sql ofzow eruit kunnen halen?

4 antwoorden

Gesponsorde links
Offline Rens - 06/10/2005 10:46
Avatar van Rens Gouden medaille

Crew algemeen
Heb je het bestand "const.php" al aangepast?
Offline SilVeX - 06/10/2005 11:09
Avatar van SilVeX HTML beginner ja
Offline Thomas - 06/10/2005 12:17 (laatste wijziging 06/10/2005 12:18)
Avatar van Thomas Moderator Moeha, misschien ligt het aan regel 55, want daar staat een ; (punt-komma) na je if-statement.

\:o/

En je else-tag heeft geen }.

Loop eerst alle fouten in je PHP-bestand eens na.
Offline ikkedikke - 06/10/2005 14:44 (laatste wijziging 06/10/2005 14:44)
Avatar van ikkedikke PHP expert en kijk naar de kleuren in de query's: als je daar geen paseerrors van rkijgt heb je een hele slimme php
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2025 Sitemasters.be - Regels - Laadtijd: 0.2s