SQL-Befehle in die Datenbank?.....
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.1, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.1, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
-
- Mitglied
- Beiträge: 196
- Registriert: 11.07.2003 11:49
- Wohnort: Köln
- Kontaktdaten:
SQL-Befehle in die Datenbank?.....
Hallo
Ich habe mit Easymod den Categories-Hierarchy-Mod installiert.
Nun wollte ich die SQL-Befehle in phpMyAdmin eintragen will, gibt es Probleme.
Dies sind die Anweisungen :
#-----[ SQL ]-------------------------------------------------
#
ALTER TABLE phpbb_categories ADD cat_main_type CHAR(1);
ALTER TABLE phpbb_categories ADD cat_main MEDIUMINT(8) UNSIGNED DEFAULT '0' NOT NULL;
ALTER TABLE phpbb_categories ADD cat_desc TEXT NOT NULL;
ALTER TABLE phpbb_categories ADD icon VARCHAR(255);
ALTER TABLE phpbb_forums ADD forum_link VARCHAR(255);
ALTER TABLE phpbb_forums ADD forum_link_internal TINYINT(1) NOT NULL;
ALTER TABLE phpbb_forums ADD forum_link_hit_count TINYINT(1) NOT NULL;
ALTER TABLE phpbb_forums ADD forum_link_hit BIGINT(20) UNSIGNED NOT NULL;
ALTER TABLE phpbb_forums ADD icon VARCHAR(255);
#
#-----[ SQL ]-------------------------------------------------
#
# the next request is optional. Run it only if you plan to use the real sub-forums feature
#
ALTER TABLE phpbb_forums ADD main_type CHAR(1);
#
#-----[ SQL ]-------------------------------------------------
#
# This part is optional : do it only if you want your users to be able to choose their setup
# if you want so, you'll have to install the MOD-mods_settings mod included in the pack
#
ALTER TABLE phpbb_users ADD user_sub_forum TINYINT(1) DEFAULT '1' NOT NULL;
ALTER TABLE phpbb_users ADD user_split_cat TINYINT(1) DEFAULT '1' NOT NULL;
ALTER TABLE phpbb_users ADD user_last_topic_title TINYINT(1) DEFAULT '1' NOT NULL;
ALTER TABLE phpbb_users ADD user_sub_level_links TINYINT(1) DEFAULT '2' NOT NULL;
ALTER TABLE phpbb_users ADD user_display_viewonline TINYINT(1) DEFAULT '2' NOT NULL;
#
Der erste Befehl wird ausgeführt, der zweite funktioniert aber schon nicht.
Zum Test habe ich den ersten noch mal ausgeführt, was wie vorher funtioniert.
Was ich nicht tat, war worher diesen "Cache-Mod" (bnötigt die 2.0.5 jetzt anscheinend) der jetzt dazu gehört zu installieren.
Ich galube das stand was davon, das der vorher rein muss.
Aber das sollte doch keinen Einfluss auf die Ausführung der Befehle oben haben (?).
Zur Not installiere ich den hinterher noch, aber so komme ich gar nicht mehr in das Forum.
Auch verstehe ich nicht ganz was die zwei optionalen Teile (s.o.) für eine Funktion haben.
Sollte ich die auch ausführen?
Den zweiten Teil (Mod für sich) des Mods an sich sollte ich anscheinend installieren, da er das ACP verbessert.
Grüße,
Tobias Claren
Ich habe mit Easymod den Categories-Hierarchy-Mod installiert.
Nun wollte ich die SQL-Befehle in phpMyAdmin eintragen will, gibt es Probleme.
Dies sind die Anweisungen :
#-----[ SQL ]-------------------------------------------------
#
ALTER TABLE phpbb_categories ADD cat_main_type CHAR(1);
ALTER TABLE phpbb_categories ADD cat_main MEDIUMINT(8) UNSIGNED DEFAULT '0' NOT NULL;
ALTER TABLE phpbb_categories ADD cat_desc TEXT NOT NULL;
ALTER TABLE phpbb_categories ADD icon VARCHAR(255);
ALTER TABLE phpbb_forums ADD forum_link VARCHAR(255);
ALTER TABLE phpbb_forums ADD forum_link_internal TINYINT(1) NOT NULL;
ALTER TABLE phpbb_forums ADD forum_link_hit_count TINYINT(1) NOT NULL;
ALTER TABLE phpbb_forums ADD forum_link_hit BIGINT(20) UNSIGNED NOT NULL;
ALTER TABLE phpbb_forums ADD icon VARCHAR(255);
#
#-----[ SQL ]-------------------------------------------------
#
# the next request is optional. Run it only if you plan to use the real sub-forums feature
#
ALTER TABLE phpbb_forums ADD main_type CHAR(1);
#
#-----[ SQL ]-------------------------------------------------
#
# This part is optional : do it only if you want your users to be able to choose their setup
# if you want so, you'll have to install the MOD-mods_settings mod included in the pack
#
ALTER TABLE phpbb_users ADD user_sub_forum TINYINT(1) DEFAULT '1' NOT NULL;
ALTER TABLE phpbb_users ADD user_split_cat TINYINT(1) DEFAULT '1' NOT NULL;
ALTER TABLE phpbb_users ADD user_last_topic_title TINYINT(1) DEFAULT '1' NOT NULL;
ALTER TABLE phpbb_users ADD user_sub_level_links TINYINT(1) DEFAULT '2' NOT NULL;
ALTER TABLE phpbb_users ADD user_display_viewonline TINYINT(1) DEFAULT '2' NOT NULL;
#
Der erste Befehl wird ausgeführt, der zweite funktioniert aber schon nicht.
Zum Test habe ich den ersten noch mal ausgeführt, was wie vorher funtioniert.
Was ich nicht tat, war worher diesen "Cache-Mod" (bnötigt die 2.0.5 jetzt anscheinend) der jetzt dazu gehört zu installieren.
Ich galube das stand was davon, das der vorher rein muss.
Aber das sollte doch keinen Einfluss auf die Ausführung der Befehle oben haben (?).
Zur Not installiere ich den hinterher noch, aber so komme ich gar nicht mehr in das Forum.
Auch verstehe ich nicht ganz was die zwei optionalen Teile (s.o.) für eine Funktion haben.
Sollte ich die auch ausführen?
Den zweiten Teil (Mod für sich) des Mods an sich sollte ich anscheinend installieren, da er das ACP verbessert.
Grüße,
Tobias Claren
-
- Mitglied
- Beiträge: 196
- Registriert: 11.07.2003 11:49
- Wohnort: Köln
- Kontaktdaten:
-
- Mitglied
- Beiträge: 196
- Registriert: 11.07.2003 11:49
- Wohnort: Köln
- Kontaktdaten:
usw......
2.)
Gebrauch von BBcodes ist übersichtlicher
Acid
Code: Alles auswählen
ALTER TABLE phpbb_forums ADD forum_link_internal TINYINT(1) NOT NULL;
3.)SQL-Befehl :
ALTER TABLE phpbb_forums ADD forum_link_internal TINYINT(1) NOT
MySQL meldet:
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Code: Alles auswählen
ALTER TABLE phpbb_forums ADD forum_link_hit_count TINYINT(1) NOT NULL;
4.)Fehler
SQL-Befehl :
ALTER TABLE phpbb_forums ADD forum_link_hit_count TINYINT(1) NOT
MySQL meldet:
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Code: Alles auswählen
ALTER TABLE phpbb_forums ADD forum_link_hit BIGINT(20) UNSIGNED NOT NULL;
5.)Fehler
SQL-Befehl :
ALTER TABLE phpbb_forums ADD forum_link_hit BIGINT(20) UNSIGNED
MySQL meldet:
Duplicate column name 'forum_link_hit'
Code: Alles auswählen
ALTER TABLE phpbb_forums ADD icon VARCHAR(255);
Alle diese Fehler treten bei den entsprechenden Befehlen auf.Fehler
SQL-Befehl :
ALTER TABLE phpbb_forums ADD icon
MySQL meldet:
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Gebrauch von BBcodes ist übersichtlicher
Acid
- itst
- Ehrenadmin
- Beiträge: 7418
- Registriert: 21.08.2001 02:00
- Wohnort: Büttelborn bei Darmstadt
- Kontaktdaten:
4) hat sich erledigt, diese Spalte gibt es schon.
Was mich bei 2) bis 5) wundert, ist das phpMyAdmin bei der Wiedergabe des Befehls jeweils in paar Zeichen hinten abschneidet. Bei 2) wird aus "NOT NULL;" am Ende "NULL"...
Bist Du sicher, jeweils den kompletten Befehl in phpMyAdmin einzugeben? Lass mal versuchsweise das Semikolon weg.
Was mich bei 2) bis 5) wundert, ist das phpMyAdmin bei der Wiedergabe des Befehls jeweils in paar Zeichen hinten abschneidet. Bei 2) wird aus "NOT NULL;" am Ende "NULL"...
Bist Du sicher, jeweils den kompletten Befehl in phpMyAdmin einzugeben? Lass mal versuchsweise das Semikolon weg.
Sascha A. Carlin,
phpBB.de Ehrenadministrator
phpBB.de Ehrenadministrator

-
- Mitglied
- Beiträge: 196
- Registriert: 11.07.2003 11:49
- Wohnort: Köln
- Kontaktdaten:
2 geht ohne ;
So nun funktioniert die zweite, aber die anderen nicht
.
3.)
5.)

3.)
Code: Alles auswählen
ALTER TABLE phpbb_forums ADD forum_link_hit_count TINYINT(1) NOT NULL
Fehler
SQL-Befehl :
ALTER TABLE phpbb_forums ADD forum_link_hit_count TINYINT(1) NOT
MySQL meldet:
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
5.)
Code: Alles auswählen
ALTER TABLE phpbb_forums ADD icon VARCHAR(255)
Fehler
SQL-Befehl :
ALTER TABLE phpbb_forums ADD icon
MySQL meldet:
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
- itst
- Ehrenadmin
- Beiträge: 7418
- Registriert: 21.08.2001 02:00
- Wohnort: Büttelborn bei Darmstadt
- Kontaktdaten:
Habe beide Queries mal gegen meine Test-DB ausgeführt und sie haben beide - wie erwartet - einwandfrei funktioniert.
Die Fehlermeldung ist allerdings komisch, weil keine korrekte Position angegeben wird.
Versuch mal, die beiden Queries mit dem MySql-Client direkt auszuführen und schau mal, was der dann sagt.
Die Fehlermeldung ist allerdings komisch, weil keine korrekte Position angegeben wird.
Versuch mal, die beiden Queries mit dem MySql-Client direkt auszuführen und schau mal, was der dann sagt.
Sascha A. Carlin,
phpBB.de Ehrenadministrator
phpBB.de Ehrenadministrator

-
- Mitglied
- Beiträge: 196
- Registriert: 11.07.2003 11:49
- Wohnort: Köln
- Kontaktdaten:
?
Ich kenne nur die phpMyAdmin-Oberfläche oberflächlich.
Was ist der MySQL-Klient?
Was ist der MySQL-Klient?
- Flachzange
- Mitglied
- Beiträge: 12
- Registriert: 29.12.2003 22:02
Versuch Dich mal damit, wenn Du den phpMyAdmin nicht so gut kennst. der rot markierte Teil sind Deine Änderungen:
<?php
define('IN_PHPBB', 1);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'config.'.$phpEx);
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/constants.'.$phpEx);
include($phpbb_root_path . 'includes/db.'.$phpEx);
// Start session management
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
// End session management
// Start User is Admin ?
if ( $userdata['user_level'] == ADMIN )
{
}
else
{
message_die(GENERAL_MESSAGE, $lang['Not_Authorised'], $lang['Not_Authorised']);
exit;
}
// End User is Admin ?
echo '<html>
<head>
<title>SQL-DB-Installer</title>
</head>
<body>
<h1>SQL-DB-Installer</h1>
<hr />';
if (!isset($HTTP_GET_VARS['install'])) {
echo '<a href="?install=1">Please click here | Bitte hier klicken</a>';
}
else {
$queries = array(
"ALTER TABLE " . $table_prefix . "categories ADD cat_main_type CHAR(1);",
"ALTER TABLE " . $table_prefix . "categories ADD cat_main MEDIUMINT(8) UNSIGNED DEFAULT '0' NOT NULL;",
"ALTER TABLE " . $table_prefix . "categories ADD cat_desc TEXT NOT NULL;",
"ALTER TABLE " . $table_prefix . "categories ADD icon VARCHAR(255);",
"ALTER TABLE " . $table_prefix . "forums ADD forum_link VARCHAR(255);",
"ALTER TABLE " . $table_prefix . "forums ADD forum_link_internal TINYINT(1) NOT NULL;",
"ALTER TABLE " . $table_prefix . "forums ADD forum_link_hit_count TINYINT(1) NOT NULL;",
"ALTER TABLE " . $table_prefix . "forums ADD forum_link_hit BIGINT(20) UNSIGNED NOT NULL;",
"ALTER TABLE " . $table_prefix . "forums ADD icon VARCHAR(255);",
"ALTER TABLE " . $table_prefix . "forums ADD main_type CHAR(1);",
"ALTER TABLE " . $table_prefix . "users ADD user_sub_forum TINYINT(1) DEFAULT '1' NOT NULL;",
"ALTER TABLE " . $table_prefix . "users ADD user_split_cat TINYINT(1) DEFAULT '1' NOT NULL;",
"ALTER TABLE " . $table_prefix . "users ADD user_last_topic_title TINYINT(1) DEFAULT '1' NOT NULL;",
"ALTER TABLE " . $table_prefix . "users ADD user_sub_level_links TINYINT(1) DEFAULT '2' NOT NULL;",
"ALTER TABLE " . $table_prefix . "users ADD user_display_viewonline TINYINT(1) DEFAULT '2' NOT NULL;"
);
$success = true;
foreach($queries as $query) {
if (!$db->sql_query($query)) {
echo '<font color="red">An error occurred ! Changes have not been entered successfully !<br /><br />Es Fehler ist aufgetreten ! Änderung nicht erfolgreich eingetragen !</font><br /><br />';
echo mysql_error();
$success = false;
break;
}
}
if ($success) {
echo '<font color="green">DB-Changes have been entered successfully. You should delete this SQL-DB-Installer as soon as possible !<br /><br />DB-Änderung wurde erfolgreich ausgeführt. Du solltest diesen SQL-DB-Installer sobald wie möglich löschen !';
}
}
?>