My news groups
hoe dan ook ben een fanaticie en quick learner alleen ben ik nog niet helemaal zeker wat de query's van de verschillende versie's van mySQL aan gaat probeer dan ook tevergeefs " my news groups te installeren ik heb mySQL 5.0.18-nt geinstalleerd en krijg bij het script waarmee ik de table's en query's moet maken dan ook steeds de fout melding over het feit dat mijn versie het ' =' teken niet lezen kan ik weet niet hoe ik dit script kan aan passen aan de versie van mySQL die ik draai. ik heb het geprobeerd te installeren met het bij geleverde phpINSTALL script waar ik de zelfde fout melding krijg. en de handmatige manier heb ik en met phpadmin 2.7.0 en met SQL yok., maar helaas tevergeefs. is er iemand die ervaring heeft met "my news groups" of iemand die me misschien helpen kan om het script voor mijn sql server werkend temaken? ik zou dit nl heel graag werkend willen krijgen.
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?
// ---------------------------------------------------------------------------- //
// MyNewsGroups :) 'Share your knowledge'
// Copyright (C) 2002 Carlos Sánchez Valle ([email protected])
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// ---------------------------------------------------------------------------- //
//------------------------------------------------------------------//
// sql.php
// Author: Carlos Sánchez
// Created: 17/09/02
//
// Description: Home Page
//
// Builds the required Databases
//
//------------------------------------------------------------------//
?>
// ---------------------------------------------------------------------------- //
// MyNewsGroups :) 'Share your knowledge'
// Copyright (C) 2002 Carlos Sánchez Valle ([email protected])
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// ---------------------------------------------------------------------------- //
//------------------------------------------------------------------//
// sql.php
// Author: Carlos Sánchez
// Created: 17/09/02
//
// Description: Home Page
//
// Builds the required Databases
//
//------------------------------------------------------------------//
?>
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<?
//------------ Create the System tables --------------- //
// ------------------ myng_admin --------------- //
$sql_query =
"CREATE TABLE `myng_admin` (
`adm_id` smallint(5) unsigned NOT NULL auto_increment,
`adm_login` varchar(20) NOT NULL default '',
`adm_passwd` varchar(20) NOT NULL default '',
`adm_email` varchar(100) NOT NULL default '',
PRIMARY KEY (`adm_id`)
)";
$db->query($sql_query);
// ------------------ myng_config --------------- //
$sql_query =
"CREATE TABLE `myng_config` (
`conf_id` tinyint(3) unsigned NOT NULL auto_increment,
`conf_active_yn` char(1) NOT NULL default '',
`conf_name` varchar(100) NOT NULL default '',
`conf_description` tinytext NOT NULL,
`conf_system_prefix` varchar(50) NOT NULL default '',
`conf_system_root` varchar(100) NOT NULL default '',
`conf_system_language` char(2) NOT NULL default '',
`conf_system_zlib_yn` char(1) NOT NULL default '',
`conf_system_debug_yn` char(1) NOT NULL default '',
`conf_system_login_yn` char(1) NOT NULL default '',
`conf_system_online_yn` char(1) NOT NULL default '',
`conf_down_days` tinyint(3) unsigned NOT NULL default '0',
`conf_down_list_items` mediumint(8) unsigned NOT NULL default '0',
`conf_down_num_groups` tinyint(3) unsigned NOT NULL default '0',
`conf_down_num_articles` tinyint(3) unsigned NOT NULL default '0',
`conf_clean_MAX_days` tinyint(3) unsigned NOT NULL default '0',
`conf_clean_MAX_articles` int(10) unsigned NOT NULL default '0',
`conf_vis_theme` varchar(50) NOT NULL default '',
`conf_vis_num_2_flames` mediumint(8) unsigned NOT NULL default '0',
`conf_vis_articles_x_page` mediumint(8) unsigned NOT NULL default '0',
`conf_vis_nav_bar_items` tinyint(3) unsigned NOT NULL default '0',
`conf_vis_nav_bar_pages` tinyint(3) unsigned NOT NULL default '0',
`conf_vis_time_highlight_new` mediumint(8) unsigned NOT NULL default '0',
`conf_sec_protect_email_yn` char(1) NOT NULL default '',
`conf_sec_send_poster_host_yn` char(1) NOT NULL default '',
`conf_sec_test_group_yn` char(1) NOT NULL default '',
`conf_sec_validate_email_yn` char(1) NOT NULL default '',
`conf_sec_secret_string` tinytext NOT NULL,
PRIMARY KEY (`conf_id`)
)";
$db->query($sql_query);
// ------------------ myng_cron --------------- //
$sql_query = "
CREATE TABLE `myng_cron` (
`cron_id` int(10) unsigned NOT NULL auto_increment,
`cron_num_times` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`cron_id`)
)";
$db->query($sql_query);
// ------------------ myng_library --------------- //
$sql_query =
"CREATE TABLE `myng_library` (
`lib_art_id` bigint(20) unsigned NOT NULL default '0',
`lib_grp_id` int(10) unsigned NOT NULL default '0',
`lib_usr_id` int(10) unsigned NOT NULL default '0',
`lib_times` tinyint(4) NOT NULL default '1',
`lib_my_article` tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (`lib_art_id`,`lib_grp_id`,`lib_usr_id`)
)";
$db->query($sql_query);
// ------------------ myng_newsgroup --------------- //
$sql_query =
"CREATE TABLE `myng_newsgroup` (
`grp_id` int(10) unsigned NOT NULL auto_increment,
`grp_name` varchar(150) NOT NULL default '',
`grp_description` text NOT NULL,
`grp_num_messages` int(10) unsigned NOT NULL default '0',
`grp_first_article` int(10) unsigned default NULL,
`grp_last_article` int(10) unsigned default NULL,
`grp_num_available` int(10) unsigned default NULL,
`grp_MAX_days` tinyint(3) unsigned NOT NULL default '0',
`grp_MAX_articles` int(10) unsigned NOT NULL default '0',
`grp_serv_id` int(10) unsigned NOT NULL default '0',
`grp_allow_post_yn` char(1) NOT NULL default '',
`grp_activity_index` float unsigned NOT NULL default '0',
PRIMARY KEY (`grp_id`)
)";
$db->query($sql_query);
// ------------------ myng_server --------------- //
$sql_query =
"CREATE TABLE `myng_server` (
`serv_id` mediumint(8) unsigned NOT NULL auto_increment,
`serv_host` varchar(60) NOT NULL default '',
`serv_port` smallint(5) unsigned NOT NULL default '119',
`serv_login` varchar(50) NOT NULL default '',
`serv_passwd` varchar(20) NOT NULL default '',
PRIMARY KEY (`serv_id`)
)";
$db->query($sql_query);
// ------------------ myng_subscription --------------- //
$sql_query =
"CREATE TABLE `myng_subscription` (
`subs_id` int(10) unsigned NOT NULL auto_increment,
`subs_grp_id` int(10) unsigned NOT NULL default '0',
`subs_usr_id` int(10) unsigned NOT NULL default '0',
`subs_last_article` int(10) unsigned default '0',
`subs_last_article_timestamp` int(10) unsigned NOT NULL default '0',
`subs_posted` tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (`subs_id`)
)";
$db->query($sql_query);
// ------------------ myng_user --------------- //
$sql_query =
"CREATE TABLE `myng_user` (
`usr_id` int(20) unsigned NOT NULL auto_increment,
`usr_name` varchar(50) NOT NULL default '',
`usr_passwd` varchar(32) NOT NULL default '',
`usr_email` varchar(30) NOT NULL default '',
`usr_email_visible_yn` char(1) NOT NULL default '',
`usr_fst_name` varchar(20) default NULL,
`usr_lst_name` varchar(20) default NULL,
`usr_country` char(2) default NULL,
`usr_icq` int(10) unsigned default NULL,
`usr_theme` varchar(20) default NULL,
`usr_text` tinytext,
`usr_reg_timestamp` int(10) default NULL,
`usr_last_log_timestamp` int(10) default NULL,
`usr_num_logs` mediumint(8) unsigned NOT NULL default '0',
PRIMARY KEY (`usr_id`),
UNIQUE KEY `email` (`usr_email`)
)";
$db->query($sql_query);
// ------------------ myng_user_online --------------- //
$sql_query=
"CREATE TABLE `myng_user_online` (
`uonl_usr_name` varchar(30) NOT NULL default '',
`uonl_session_time` bigint(10) NOT NULL default '0',
`uonl_message_inbox` tinytext,
`uonl_chat_room` varchar(20) default NULL,
`uonl_message_time` bigint(20) default '0',
`uonl_message_from` varchar(20) default NULL,
PRIMARY KEY (`uonl_usr_name`)
)";
$db->query($sql_query);
// Insert the data into myng_config table
$sql_query = "INSERT INTO myng_config (
conf_active_yn,
conf_name,
conf_description,
conf_system_prefix,
conf_system_root,
conf_system_language,
conf_system_zlib_yn,
conf_system_debug_yn,
conf_system_login_yn,
conf_system_online_yn,
conf_down_days,
conf_down_list_items,
conf_down_num_groups,
conf_down_num_articles,
conf_vis_theme,
conf_vis_num_2_flames,
conf_vis_articles_x_page,
conf_vis_nav_bar_items,
conf_vis_nav_bar_pages,
conf_vis_time_highlight_new,
conf_sec_send_poster_host_yn,
conf_sec_test_group_yn,
conf_sec_validate_email_yn,
conf_sec_secret_string
) VALUES (
'Y',
'Default',
'Default Configuration',
'".$_POST['script_path']."',
'".rtrim($_SERVER['DOCUMENT_ROOT'],'/').$_POST['script_path']."',
'".$_POST['conf_system_language']."',
'".$_POST['conf_system_zlib_yn']."',
'Y',
'Y',
'Y',
4,
10,
2,
1,
'standard',
50,
10,
10,
5,
86400,
'N',
'N',
'N',
'howmuchwoodwouldawoodchuck
chuckifawoodchuckcould
chuckwood...'
)";
$db->query($sql_query);
//------------ Create the System tables --------------- //
// ------------------ myng_admin --------------- //
$sql_query =
"CREATE TABLE `myng_admin` (
`adm_id` smallint(5) unsigned NOT NULL auto_increment,
`adm_login` varchar(20) NOT NULL default '',
`adm_passwd` varchar(20) NOT NULL default '',
`adm_email` varchar(100) NOT NULL default '',
PRIMARY KEY (`adm_id`)
)";
$db->query($sql_query);
// ------------------ myng_config --------------- //
$sql_query =
"CREATE TABLE `myng_config` (
`conf_id` tinyint(3) unsigned NOT NULL auto_increment,
`conf_active_yn` char(1) NOT NULL default '',
`conf_name` varchar(100) NOT NULL default '',
`conf_description` tinytext NOT NULL,
`conf_system_prefix` varchar(50) NOT NULL default '',
`conf_system_root` varchar(100) NOT NULL default '',
`conf_system_language` char(2) NOT NULL default '',
`conf_system_zlib_yn` char(1) NOT NULL default '',
`conf_system_debug_yn` char(1) NOT NULL default '',
`conf_system_login_yn` char(1) NOT NULL default '',
`conf_system_online_yn` char(1) NOT NULL default '',
`conf_down_days` tinyint(3) unsigned NOT NULL default '0',
`conf_down_list_items` mediumint(8) unsigned NOT NULL default '0',
`conf_down_num_groups` tinyint(3) unsigned NOT NULL default '0',
`conf_down_num_articles` tinyint(3) unsigned NOT NULL default '0',
`conf_clean_MAX_days` tinyint(3) unsigned NOT NULL default '0',
`conf_clean_MAX_articles` int(10) unsigned NOT NULL default '0',
`conf_vis_theme` varchar(50) NOT NULL default '',
`conf_vis_num_2_flames` mediumint(8) unsigned NOT NULL default '0',
`conf_vis_articles_x_page` mediumint(8) unsigned NOT NULL default '0',
`conf_vis_nav_bar_items` tinyint(3) unsigned NOT NULL default '0',
`conf_vis_nav_bar_pages` tinyint(3) unsigned NOT NULL default '0',
`conf_vis_time_highlight_new` mediumint(8) unsigned NOT NULL default '0',
`conf_sec_protect_email_yn` char(1) NOT NULL default '',
`conf_sec_send_poster_host_yn` char(1) NOT NULL default '',
`conf_sec_test_group_yn` char(1) NOT NULL default '',
`conf_sec_validate_email_yn` char(1) NOT NULL default '',
`conf_sec_secret_string` tinytext NOT NULL,
PRIMARY KEY (`conf_id`)
)";
$db->query($sql_query);
// ------------------ myng_cron --------------- //
$sql_query = "
CREATE TABLE `myng_cron` (
`cron_id` int(10) unsigned NOT NULL auto_increment,
`cron_num_times` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`cron_id`)
)";
$db->query($sql_query);
// ------------------ myng_library --------------- //
$sql_query =
"CREATE TABLE `myng_library` (
`lib_art_id` bigint(20) unsigned NOT NULL default '0',
`lib_grp_id` int(10) unsigned NOT NULL default '0',
`lib_usr_id` int(10) unsigned NOT NULL default '0',
`lib_times` tinyint(4) NOT NULL default '1',
`lib_my_article` tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (`lib_art_id`,`lib_grp_id`,`lib_usr_id`)
)";
$db->query($sql_query);
// ------------------ myng_newsgroup --------------- //
$sql_query =
"CREATE TABLE `myng_newsgroup` (
`grp_id` int(10) unsigned NOT NULL auto_increment,
`grp_name` varchar(150) NOT NULL default '',
`grp_description` text NOT NULL,
`grp_num_messages` int(10) unsigned NOT NULL default '0',
`grp_first_article` int(10) unsigned default NULL,
`grp_last_article` int(10) unsigned default NULL,
`grp_num_available` int(10) unsigned default NULL,
`grp_MAX_days` tinyint(3) unsigned NOT NULL default '0',
`grp_MAX_articles` int(10) unsigned NOT NULL default '0',
`grp_serv_id` int(10) unsigned NOT NULL default '0',
`grp_allow_post_yn` char(1) NOT NULL default '',
`grp_activity_index` float unsigned NOT NULL default '0',
PRIMARY KEY (`grp_id`)
)";
$db->query($sql_query);
// ------------------ myng_server --------------- //
$sql_query =
"CREATE TABLE `myng_server` (
`serv_id` mediumint(8) unsigned NOT NULL auto_increment,
`serv_host` varchar(60) NOT NULL default '',
`serv_port` smallint(5) unsigned NOT NULL default '119',
`serv_login` varchar(50) NOT NULL default '',
`serv_passwd` varchar(20) NOT NULL default '',
PRIMARY KEY (`serv_id`)
)";
$db->query($sql_query);
// ------------------ myng_subscription --------------- //
$sql_query =
"CREATE TABLE `myng_subscription` (
`subs_id` int(10) unsigned NOT NULL auto_increment,
`subs_grp_id` int(10) unsigned NOT NULL default '0',
`subs_usr_id` int(10) unsigned NOT NULL default '0',
`subs_last_article` int(10) unsigned default '0',
`subs_last_article_timestamp` int(10) unsigned NOT NULL default '0',
`subs_posted` tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (`subs_id`)
)";
$db->query($sql_query);
// ------------------ myng_user --------------- //
$sql_query =
"CREATE TABLE `myng_user` (
`usr_id` int(20) unsigned NOT NULL auto_increment,
`usr_name` varchar(50) NOT NULL default '',
`usr_passwd` varchar(32) NOT NULL default '',
`usr_email` varchar(30) NOT NULL default '',
`usr_email_visible_yn` char(1) NOT NULL default '',
`usr_fst_name` varchar(20) default NULL,
`usr_lst_name` varchar(20) default NULL,
`usr_country` char(2) default NULL,
`usr_icq` int(10) unsigned default NULL,
`usr_theme` varchar(20) default NULL,
`usr_text` tinytext,
`usr_reg_timestamp` int(10) default NULL,
`usr_last_log_timestamp` int(10) default NULL,
`usr_num_logs` mediumint(8) unsigned NOT NULL default '0',
PRIMARY KEY (`usr_id`),
UNIQUE KEY `email` (`usr_email`)
)";
$db->query($sql_query);
// ------------------ myng_user_online --------------- //
$sql_query=
"CREATE TABLE `myng_user_online` (
`uonl_usr_name` varchar(30) NOT NULL default '',
`uonl_session_time` bigint(10) NOT NULL default '0',
`uonl_message_inbox` tinytext,
`uonl_chat_room` varchar(20) default NULL,
`uonl_message_time` bigint(20) default '0',
`uonl_message_from` varchar(20) default NULL,
PRIMARY KEY (`uonl_usr_name`)
)";
$db->query($sql_query);
// Insert the data into myng_config table
$sql_query = "INSERT INTO myng_config (
conf_active_yn,
conf_name,
conf_description,
conf_system_prefix,
conf_system_root,
conf_system_language,
conf_system_zlib_yn,
conf_system_debug_yn,
conf_system_login_yn,
conf_system_online_yn,
conf_down_days,
conf_down_list_items,
conf_down_num_groups,
conf_down_num_articles,
conf_vis_theme,
conf_vis_num_2_flames,
conf_vis_articles_x_page,
conf_vis_nav_bar_items,
conf_vis_nav_bar_pages,
conf_vis_time_highlight_new,
conf_sec_send_poster_host_yn,
conf_sec_test_group_yn,
conf_sec_validate_email_yn,
conf_sec_secret_string
) VALUES (
'Y',
'Default',
'Default Configuration',
'".$_POST['script_path']."',
'".rtrim($_SERVER['DOCUMENT_ROOT'],'/').$_POST['script_path']."',
'".$_POST['conf_system_language']."',
'".$_POST['conf_system_zlib_yn']."',
'Y',
'Y',
'Y',
4,
10,
2,
1,
'standard',
50,
10,
10,
5,
86400,
'N',
'N',
'N',
'howmuchwoodwouldawoodchuck
chuckifawoodchuckcould
chuckwood...'
)";
$db->query($sql_query);
Gewijzigd op 01/01/1970 01:00:00 door Peggy
Hmmm moment ik vraag PHPerik ff om hulp. Hij weet namelijk alles, btw niet mijn woorden.... Mo-nU-men-tje.
Wat is de precieze error want ik zie geen syntax fouten zo snel. Ik zie ook geen =-tekens.
ik had hiet boven het scipt geplaats en niet de exate error melding ik zal de query nog eens in phpMYadmin in geven en dan de error melding plaatsen
Ja, sorry, maar ik heb MySQL even niet draaien op deze computer, dus ik kan het even niet testen.
Fout
SQL-query:
$sql_query = "CREATE TABLE `myng_admin` ( `adm_id` smallint(5) unsigned NOT NULL auto_increment, `adm_login` varchar(20) NOT NULL default '', `adm_passwd` varchar(20) NOT NULL default '', `adm_email` varchar(100) NOT NULL default '', PRIMARY KEY (`adm_id`) )";
MySQL retourneerde:
#1064 - 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 '$sql_query =
"CREATE TABLE `myng_admin` (
`adm_id` smallint(5) unsigned NOT' at line 1
probeer je een var in te voeren in PHPmyAdmin??
Quote:
Uw SQL-query is succesvol uitgevoerd. (Query duurde 0.1416 sec)
SQL-query:
CREATE TABLE `myng_admin` (
`adm_id` smallint( 5 ) unsigned NOT NULL AUTO_INCREMENT ,
`adm_login` varchar( 20 ) NOT NULL default '',
`adm_passwd` varchar( 20 ) NOT NULL default '',
`adm_email` varchar( 100 ) NOT NULL default '',
PRIMARY KEY ( `adm_id` )
)
SQL-query:
CREATE TABLE `myng_admin` (
`adm_id` smallint( 5 ) unsigned NOT NULL AUTO_INCREMENT ,
`adm_login` varchar( 20 ) NOT NULL default '',
`adm_passwd` varchar( 20 ) NOT NULL default '',
`adm_email` varchar( 100 ) NOT NULL default '',
PRIMARY KEY ( `adm_id` )
)
Ik heb inderdaad het idee dat je ook de PHP variabele meekopieert.
en ff een stom vraagje wat is precies een ' var' sorry wil niet stom over komen maar zoals gezegt ik begin net en ken me nog niet helemaal met de benamingen uit
en dit is wat er op mijn scherm verschijnt als ik gewoon de install.php gebruik
kan bepaalde soorten gegevens onthouden.
$var = 'tekst';
echo $var;
geef dus .... ??
"CREATE TABLE `myng_admin` (
`adm_id` smallint(5) unsigned NOT NULL auto_increment,
`adm_login` varchar(20) NOT NULL default '',
`adm_passwd` varchar(20) NOT NULL default '',
`adm_email` varchar(100) NOT NULL default '',
PRIMARY KEY (`adm_id`)
)";
$db->query($sql_query);
zo bedoel je?
Code (php)
1
2
3
4
5
6
7
2
3
4
5
6
7
CREATE TABLE `myng_admin` (
`adm_id` smallint(5) unsigned NOT NULL auto_increment,
`adm_login` varchar(20) NOT NULL default '',
`adm_passwd` varchar(20) NOT NULL default '',
`adm_email` varchar(100) NOT NULL default '',
PRIMARY KEY (`adm_id`)
)
`adm_id` smallint(5) unsigned NOT NULL auto_increment,
`adm_login` varchar(20) NOT NULL default '',
`adm_passwd` varchar(20) NOT NULL default '',
`adm_email` varchar(100) NOT NULL default '',
PRIMARY KEY (`adm_id`)
)
Dus zonder elke vorm van PHP.
Uw SQL-query is succesvol uitgevoerd. (Query duurde 0.3967 sec)SQL-query:CREATE TABLE `myng_admin` (
`adm_id` smallint( 5 ) unsigned NOT NULL AUTO_INCREMENT ,
`adm_login` varchar( 20 ) NOT NULL default '',
`adm_passwd` varchar( 20 ) NOT NULL default '',
`adm_email` varchar( 100 ) NOT NULL default '',
PRIMARY KEY ( `adm_id` )
connect(); // MyNG setting up... init(); // Templates $t = new Template($_SESSION['conf_system_root']."/admin/templates/"); // Check Authentication if(isset($_SESSION['adm_id'])){ // Administration Session has started header("Location:"."admin_home.php" ); } if(isset($_POST['login'])){ // El usuario ha enviado su información // de autenticación. // Comprobamos que los datos son correctos // con la base de datos $query = "SELECT adm_id, adm_login FROM myng_admin WHERE adm_login = '".$_POST['identificativo']."' AND adm_passwd = '".$_POST['password']."'"; $db->query($query); if($db->num_rows() == "0"){ // El Login ha sido incorrecto // Mostramos un mensaje de error y el // formulario nuevamente. $t->set_var("identificativo",$identificativo); $t->set_var("mensaje_error","Error: Login Incorrect"); // Cambiamos la raiz para poder cargar estos archivos $t->set_root($_SESSION['conf_system_root']."/admin/templates/"); // Asignamos la plantilla principal a main $main = "login_admin.htm"; $t->set_file("main",$main); // ---- Show the HTML ---- // show_iface($main); // ----------------------- // }else{ // El login se ha producido de manera correcta, // Iniciamos la sesión del usuario. $db->next_record(); // Inicializamos las variables de sesión del asociado $_SESSION['adm_login'] = $db->Record['adm_login']; $_SESSION['adm_id'] = $db->Record['adm_id']; //echo $db->Record['adm_id']; //session_register("Admin"); header("Location:"."admin_home.php" ); } }else{ // Mostramos el formulario $main = "login_admin.htm"; $t->set_file("main",$main); // ---- Show the HTML ---- // show_iface($main); // ----------------------- // } ?>
// Main Template
$main = "master.htm";
$t->set_file("main",$main);
kan het misschien zo zijn dat het eigenlijk dit hoort tezijn?:
// Main Template
$main = "master.html";
$t->set_file("main",$main);
op ieder php script in my mews groups staat het nl zo vermeld