Pagina 1 van 1
hoe moet je een eigen install maken
Geplaatst: 26 sep 2003, 19:28
door racefreak
hallo,
kan iemand mij helpen om een eigen installer te maken voor sql queries toe te voegen aan de database.
dus als iemand dat opent voegt dat filetje automatische de info toe aan de database via een .sql bestand.
kan iemand mij dat uitleggen hoe?
groetjes brendan
Geplaatst: 26 sep 2003, 19:44
door mosymuis
Ik geloof dat het volgende moet werken; vul bij ~~~SQL~~~ je SQL code in, sla hem op als update.php in je phpBB root en voer hem online uit.
Code: Selecteer alles
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
$page_title = 'Updating the database';
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
echo '<table width="100%" cellspacing="1" cellpadding="2" border="0" class="forumline">';
echo '<tr><th>Updating the database</th></tr><tr><td><span class="genmed"><ul type="circle">';
$sql = array();
$sql[] = "~~~SQL~~~";
for( $i = 0; $i < count($sql); $i++ )
{
if( !$result = $db->sql_query ($sql[$i]) )
{
$error = $db->sql_error();
echo '<li>' . $sql[$i] . '<br /> +++ <font color="#FF0000"><b>Error:</b></font> ' . $error['message'] . '</li><br />';
}
else
{
echo '<li>' . $sql[$i] . '<br /> +++ <font color="#00AA00"><b>Successfull</b></font></li><br />';
}
}
echo '</ul></span></td></tr><tr><td class="catBottom" height="28"> </td></tr>';
echo '<tr><th>End</th></tr><tr><td><span class="genmed">Installation is now finished. Please be sure to delete this file now.<br />If you have run into any errors, please visit the <a href="http://www.phpbbhacks.com/forums" target="_phpbbhacks">phpBBHacks.com support forums</a> and ask someone for help.</span></td></tr>';
echo '<tr><td class="catBottom" height="28" align="center"><span class="genmed"><a href="' . append_sid("index.$phpEx") . '">Have a nice day</a></span></td></table>';
include($phpbb_root_path . 'includes/page_tail.'.$phpEx);
?>
thkz
Geplaatst: 27 sep 2003, 10:53
door racefreak
ik zal het gelijk gaan uitproberen