setting uit db in variable stoppen
Ik zou uit mijn database gegevens willen halen en ze in een variable stoppen.
database:
nu zou ik er willen voor zorgen dat ik in een keer (dus niet alles appart selecteren en $site_year = $row_year['value'])
maar hoe kan ik hier voor zorgen.
dus als het script is uitgevoerd:
$site_name = 'test';
$site_year = '2009';
mvg kasper
Gewijzigd op 01/01/1970 01:00:00 door Jesper Diovo
Code (php)
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
<?php
$sql = "SELECT * FROM `settings`";
$result = mysql_query($sql);
while($row = mysql_fetch_assoc($result)){
$$row['name'] = $row['value']; //line 14
}
?>
$sql = "SELECT * FROM `settings`";
$result = mysql_query($sql);
while($row = mysql_fetch_assoc($result)){
$$row['name'] = $row['value']; //line 14
}
?>
foutafhandeling, dat helpt bij het debuggen.
Hoe ziet settings eruit? Is dat die tabel met id, name en value? Doe trouwens wat aan Jezpur schreef op 19.04.2009 16:03:
Hoe ziet settings eruit? Is dat die tabel met id, name en value? Doe trouwens wat aan foutafhandeling, dat helpt bij het debuggen.
ik weet het..
normaal zet ik er een or die (mysql_error());
maar ik doe het er weer van tussen als hij online komt..
ik vind dat niet mooi voor de gebruiker
Waarom wil je zo'n idiote constructie hebben. Dit is vragen om problemen.
SanThe schreef op 19.04.2009 16:33:
Waarom wil je zo'n idiote constructie hebben. Dit is vragen om problemen.
ik wil gewoon weten of het mogelijk is..
en hoe kan ik er anders voor zorgen dat mijn variables de naam krijgen van $$row['name'] ====> $site_name
en die een value geven ====> $row['value']
?
Gewijzigd op 01/01/1970 01:00:00 door Kasper Heyndrickx
In de while zal de value bij 'site_name' altijd bij site_name horen. Dus als je in de while doet wat je met die values wilt doen, heb je die variabele variabelenamen niet nodig.
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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
<?php
/**
* SQL database class
* 2009-03-28
* Toby Hinloopen
*/
class sql {
private static $default_host;
private static $default_username;
private static $default_password;
private static $default_database;
public static $default_instance;
private $connection;
private $last_error_id;
private $last_error_str;
private $last_raw_result;
public static $queries = array();
public static function set_defaults($host = false,$user = false,$pass = false,$db = false) {
if(is_string($host)) {//if host is not set correctly and default_host is set...
self::$default_host = $host;
}
if(is_string($user)) {//if user is not set correctly and default_username is set...
self::$default_username = $user;
}
if(is_string($pass)) {//if pass is not set correctly and default_password is set...
self::$default_password = $pass;
}
if(is_string($db)) {//if db is not set correctly and default_database is set...
self::$default_database = $db;
}
}
//object constructor
public function __construct($host = false,$user = false,$pass = false,$db = false,$force_set_as_default = false) {
if($force_set_as_default
|| !isset(self::$default_instance)) {//if default_instance should be force-overwritten OR it is not set...
$this->as_default();
}
$this->connect($host,$user,$pass,$db);
}
//static constructor
public static function init($host = false,$user = false,$pass = false,$db = false) {
return self::$default_instance = new self($host,$user,$pass,$db,true);
}
public function as_default() {
if(!isset($this)) {
error(8,'Function sql::as_default cannot be used in static context.');
return false;
}
self::$default_instance = $this;
}
public function connect($host = false,$user = false,$pass = false,$db = false) {
if(!isset($this)) {
error(9,'Function sql::connect cannot be used in static context.');
return false;
}
if(!is_string($host)
&& is_string(self::$default_host)) {//if host is not set correctly and default_host is set...
$host = self::$default_host;
}
if(!is_string($user)
&& is_string(self::$default_username)) {//if user is not set correctly and default_username is set...
$user = self::$default_username;
}
if(!is_string($pass)
&& is_string(self::$default_password)) {//if user is not set correctly and default_password is set...
$pass = self::$default_password;
}
if(!is_string($db)
&& is_string(self::$default_database)) {//if database is not set correctly and default_database is set...
$db = self::$default_database;
}
$this->connection = mysql_connect($host,$user,$pass);
if(!$this->connection) {
$this->error(1,'Could not connect to MySQL server: '.mysql_error());
return false;
} else {
mysql_set_charset('utf8',$this->connection);
if(is_string($db) && !mysql_select_db($db,$this->connection)) {
$this->error(2,'Could not select database: '.mysql_error());
return false;
}
return true;
}
}
public function escape($string) {
if(!isset($this)) {
if(!is_resource(self::$default_instance)) {
self::connect();
}
return self::$default_instance->escape($string);
}
return (string)mysql_real_escape_string((string)$string,$this->connection);
}
public function query($query) {
if(!isset($this)) {
return self::$default_instance->query($query);
}
self::$queries[] = 'BUFFERED("'.addslashes($query).'"): '.(string)$this->connection;
if($r = mysql_query($query,$this->connection)) {
$this->last_raw_result = $r;
return $r;
} else {
$this->error(3,'MySQL query failed: '.mysql_error());
return false;
}
}
public function unbuffered_query($query) {
if(!isset($this)) {
return self::$default_instance->unbuffered_query($query);
}
self::$queries[] = 'UNBUFFERED("'.addslashes($query).'"): '.(string)$this->connection;
if($r = mysql_unbuffered_query($query,$this->connection)) {
$this->last_raw_result = $r;
return $r;
} else {
$this->error(4,'unbuffered MySQL query failed: '.mysql_error());
return false;
}
}
public function free($result = false) {
if(is_resource($result)) {
return mysql_free_result($result);
} elseif(!isset($this)) {
return self::$default_instance->free($result);
} elseif(is_resource($this->last_raw_result)) {
$succes = mysql_free_result($this->last_raw_result);
$this->last_raw_result = null;
return $succes;
} else {
$this->error(5,'No result to free');
return false;
}
}
public function query_result_int($query) {
if(!isset($this)) {
return self::$default_instance->query_result_int($query);
}
$r = $this->query_result_row($query,false);
return (int)$r[0];
}
public function query_result_string($query) {
if(!isset($this)) {
return self::$default_instance->query_result_string($query);
}
$r = $this->query_result_row($query,false);
return (string)$r[0];
}
public function query_result_unixtime($query) {
if(!isset($this)) {
return self::$default_instance->query_result_unixtime($query);
}
$r = $this->query_result_row($query,false);
return (int)strtotime($r[0]);
}
public function query_result_row($query,$autoformat = true) {
if(!isset($this)) {
return self::$default_instance->query_result_row($query,$autoformat);
}
$rr = $this->query($query);
if(!$rr) {
return false;
}
if($r = mysql_fetch_row($rr)) {
foreach($r as $key=>$value) {
if($autoformat) {
$type = mysql_field_type($rr,$key);
if($type == 'int') {
$r[$key] = (int)$value;
} elseif($type == 'timestamp') {
$r[$key] = (int)strtotime($value);
} else {
$r[$key] = $value;
}
}
}
$this->free();
return $r;
} else {
return array();
}
}
public function query_result_assoc($query,$autoformat = true) {
if(!isset($this)) {
return self::$default_instance->query_result_assoc($query,$autoformat);
}
$rr = $this->query($query);
if(!$rr) {
return false;
}
if($r = mysql_fetch_assoc($rr)) {
if($autoformat) {
$keys=array_keys($r);
$types=array();
foreach($keys as $offset=>$key) {
$types[$key] = mysql_field_type($rr,$offset);
}
foreach($r as $key=>$value) {
if($types[$key] == 'int') {
$r[$key] = (int)$value;
} elseif($types[$key] == 'timestamp') {
$r[$key] = (int)strtotime($value);
} else {
$r[$key] = $value;
}
}
}
return $r;
} else {
return array();
}
}
public function query_result_auto($query,$indexkey = false,$allowmultidimarray = false,$autoformat = true) {
if(!isset($this)) {
return self::$default_instance->query_result_auto($query,$indexkey,$allowmultidimarray,$autoformat);
}
$rr = $this->unbuffered_query($query);
if(!$rr) {
return false;
}
$output = array();
while($r = mysql_fetch_assoc($rr)) {
if(!isset($keys)) {
$keys=array_keys($r);
if($autoformat) {
$types=array();
foreach($keys as $offset=>$key) {
$types[$key] = mysql_field_type($rr,$offset);
}
}
}
if($autoformat) {
foreach($r as $key=>$value) {
if($types[$key] == 'int') {
$r[$key] = (int)$value;
} elseif($types[$key] == 'timestamp') {
$r[$key] = (int)strtotime($value);
} else {
$r[$key] = $value;
}
}
}
if($indexkey===false) {
if(count($r)>1) {
$output[] = $r;
} else {
$keys=array_keys($r);
$output[] = $r[$keys[0]];
}
} elseif(count($r)!=2) {
if($allowmultidimarray===false) {
$output[$r[$indexkey]]=$r;
} elseif(!isset($output[$r[$indexkey]])) {
$output[$r[$indexkey]]=array($r);
} else {
array_push($output[$r[$indexkey]],$r);
}
} else {
if($keys[0]!=$indexkey) {
$output[$r[$indexkey]]=$r[$keys[0]];
} else {
$output[$r[$indexkey]]=$r[$keys[1]];
}
}
}
return $output;
}
public function delete($from,$where = '1') {
if(!isset($this)) {
return self::$default_instance->delete($from,$where);
}
$this->query('DELETE FROM `'.$from.'` WHERE '.$where);
return mysql_affected_rows($this->connection);
}
public function update($table,$values = array(),$where = '1') {
if(!isset($this)) {
return self::$default_instance->update($table,$values,$where);
}
$sqlvalues = '';
foreach($values as $key=>$value) {
if($sqlvalue != '') {
$sqlvalue.=', ';
}
$sqlvalue .= '`'.$key.'` = "'.$this->escape($value).'"';
}
$this->query('UPDATE `'.$table.'` SET '.$sqlvalues.' WHERE '.$where);
return mysql_affected_rows($this->connection);
}
public function insert($into,$values = array()) {
if(!isset($this)) {
return self::$default_instance->insert($into,$values);
}
$keys = '';
$values = '';
foreach($values as $key=>$value) {
if($keys != '') {
$keys .= ', ';
}
if($values != '') {
$values .= ', ';
}
$keys .= '`'.$key.'`';
$values .= '\''.$this->escape($value).'\'';
}
$this->query('INSERT INTO `'.$into.'` ('.$keys.') VALUES ('.$values.')');
return mysql_insert_id($this->connection);
//INSERT INTO `livphp4`.`filesystem` (`id`, `name`, `location`, `data`, `type`) VALUES (NULL, 'abcd', '0', '', 'folder');
}
private function error($id,$str) {
if(!isset($this)) {
return self::$default_instance->error($id,$str);
}
$this->last_error_id = $id;
$this->last_error_str = $str;
classerror($this);
return true;
}
public function error_id() {
if(!isset($this)) {
return self::$default_instance->error_id();
}
return $this->last_error_id;
}
public function error_str() {
if(!isset($this)) {
return self::$default_instance->error_str();
}
return $this->last_error_str;
}
}
?>
/**
* SQL database class
* 2009-03-28
* Toby Hinloopen
*/
class sql {
private static $default_host;
private static $default_username;
private static $default_password;
private static $default_database;
public static $default_instance;
private $connection;
private $last_error_id;
private $last_error_str;
private $last_raw_result;
public static $queries = array();
public static function set_defaults($host = false,$user = false,$pass = false,$db = false) {
if(is_string($host)) {//if host is not set correctly and default_host is set...
self::$default_host = $host;
}
if(is_string($user)) {//if user is not set correctly and default_username is set...
self::$default_username = $user;
}
if(is_string($pass)) {//if pass is not set correctly and default_password is set...
self::$default_password = $pass;
}
if(is_string($db)) {//if db is not set correctly and default_database is set...
self::$default_database = $db;
}
}
//object constructor
public function __construct($host = false,$user = false,$pass = false,$db = false,$force_set_as_default = false) {
if($force_set_as_default
|| !isset(self::$default_instance)) {//if default_instance should be force-overwritten OR it is not set...
$this->as_default();
}
$this->connect($host,$user,$pass,$db);
}
//static constructor
public static function init($host = false,$user = false,$pass = false,$db = false) {
return self::$default_instance = new self($host,$user,$pass,$db,true);
}
public function as_default() {
if(!isset($this)) {
error(8,'Function sql::as_default cannot be used in static context.');
return false;
}
self::$default_instance = $this;
}
public function connect($host = false,$user = false,$pass = false,$db = false) {
if(!isset($this)) {
error(9,'Function sql::connect cannot be used in static context.');
return false;
}
if(!is_string($host)
&& is_string(self::$default_host)) {//if host is not set correctly and default_host is set...
$host = self::$default_host;
}
if(!is_string($user)
&& is_string(self::$default_username)) {//if user is not set correctly and default_username is set...
$user = self::$default_username;
}
if(!is_string($pass)
&& is_string(self::$default_password)) {//if user is not set correctly and default_password is set...
$pass = self::$default_password;
}
if(!is_string($db)
&& is_string(self::$default_database)) {//if database is not set correctly and default_database is set...
$db = self::$default_database;
}
$this->connection = mysql_connect($host,$user,$pass);
if(!$this->connection) {
$this->error(1,'Could not connect to MySQL server: '.mysql_error());
return false;
} else {
mysql_set_charset('utf8',$this->connection);
if(is_string($db) && !mysql_select_db($db,$this->connection)) {
$this->error(2,'Could not select database: '.mysql_error());
return false;
}
return true;
}
}
public function escape($string) {
if(!isset($this)) {
if(!is_resource(self::$default_instance)) {
self::connect();
}
return self::$default_instance->escape($string);
}
return (string)mysql_real_escape_string((string)$string,$this->connection);
}
public function query($query) {
if(!isset($this)) {
return self::$default_instance->query($query);
}
self::$queries[] = 'BUFFERED("'.addslashes($query).'"): '.(string)$this->connection;
if($r = mysql_query($query,$this->connection)) {
$this->last_raw_result = $r;
return $r;
} else {
$this->error(3,'MySQL query failed: '.mysql_error());
return false;
}
}
public function unbuffered_query($query) {
if(!isset($this)) {
return self::$default_instance->unbuffered_query($query);
}
self::$queries[] = 'UNBUFFERED("'.addslashes($query).'"): '.(string)$this->connection;
if($r = mysql_unbuffered_query($query,$this->connection)) {
$this->last_raw_result = $r;
return $r;
} else {
$this->error(4,'unbuffered MySQL query failed: '.mysql_error());
return false;
}
}
public function free($result = false) {
if(is_resource($result)) {
return mysql_free_result($result);
} elseif(!isset($this)) {
return self::$default_instance->free($result);
} elseif(is_resource($this->last_raw_result)) {
$succes = mysql_free_result($this->last_raw_result);
$this->last_raw_result = null;
return $succes;
} else {
$this->error(5,'No result to free');
return false;
}
}
public function query_result_int($query) {
if(!isset($this)) {
return self::$default_instance->query_result_int($query);
}
$r = $this->query_result_row($query,false);
return (int)$r[0];
}
public function query_result_string($query) {
if(!isset($this)) {
return self::$default_instance->query_result_string($query);
}
$r = $this->query_result_row($query,false);
return (string)$r[0];
}
public function query_result_unixtime($query) {
if(!isset($this)) {
return self::$default_instance->query_result_unixtime($query);
}
$r = $this->query_result_row($query,false);
return (int)strtotime($r[0]);
}
public function query_result_row($query,$autoformat = true) {
if(!isset($this)) {
return self::$default_instance->query_result_row($query,$autoformat);
}
$rr = $this->query($query);
if(!$rr) {
return false;
}
if($r = mysql_fetch_row($rr)) {
foreach($r as $key=>$value) {
if($autoformat) {
$type = mysql_field_type($rr,$key);
if($type == 'int') {
$r[$key] = (int)$value;
} elseif($type == 'timestamp') {
$r[$key] = (int)strtotime($value);
} else {
$r[$key] = $value;
}
}
}
$this->free();
return $r;
} else {
return array();
}
}
public function query_result_assoc($query,$autoformat = true) {
if(!isset($this)) {
return self::$default_instance->query_result_assoc($query,$autoformat);
}
$rr = $this->query($query);
if(!$rr) {
return false;
}
if($r = mysql_fetch_assoc($rr)) {
if($autoformat) {
$keys=array_keys($r);
$types=array();
foreach($keys as $offset=>$key) {
$types[$key] = mysql_field_type($rr,$offset);
}
foreach($r as $key=>$value) {
if($types[$key] == 'int') {
$r[$key] = (int)$value;
} elseif($types[$key] == 'timestamp') {
$r[$key] = (int)strtotime($value);
} else {
$r[$key] = $value;
}
}
}
return $r;
} else {
return array();
}
}
public function query_result_auto($query,$indexkey = false,$allowmultidimarray = false,$autoformat = true) {
if(!isset($this)) {
return self::$default_instance->query_result_auto($query,$indexkey,$allowmultidimarray,$autoformat);
}
$rr = $this->unbuffered_query($query);
if(!$rr) {
return false;
}
$output = array();
while($r = mysql_fetch_assoc($rr)) {
if(!isset($keys)) {
$keys=array_keys($r);
if($autoformat) {
$types=array();
foreach($keys as $offset=>$key) {
$types[$key] = mysql_field_type($rr,$offset);
}
}
}
if($autoformat) {
foreach($r as $key=>$value) {
if($types[$key] == 'int') {
$r[$key] = (int)$value;
} elseif($types[$key] == 'timestamp') {
$r[$key] = (int)strtotime($value);
} else {
$r[$key] = $value;
}
}
}
if($indexkey===false) {
if(count($r)>1) {
$output[] = $r;
} else {
$keys=array_keys($r);
$output[] = $r[$keys[0]];
}
} elseif(count($r)!=2) {
if($allowmultidimarray===false) {
$output[$r[$indexkey]]=$r;
} elseif(!isset($output[$r[$indexkey]])) {
$output[$r[$indexkey]]=array($r);
} else {
array_push($output[$r[$indexkey]],$r);
}
} else {
if($keys[0]!=$indexkey) {
$output[$r[$indexkey]]=$r[$keys[0]];
} else {
$output[$r[$indexkey]]=$r[$keys[1]];
}
}
}
return $output;
}
public function delete($from,$where = '1') {
if(!isset($this)) {
return self::$default_instance->delete($from,$where);
}
$this->query('DELETE FROM `'.$from.'` WHERE '.$where);
return mysql_affected_rows($this->connection);
}
public function update($table,$values = array(),$where = '1') {
if(!isset($this)) {
return self::$default_instance->update($table,$values,$where);
}
$sqlvalues = '';
foreach($values as $key=>$value) {
if($sqlvalue != '') {
$sqlvalue.=', ';
}
$sqlvalue .= '`'.$key.'` = "'.$this->escape($value).'"';
}
$this->query('UPDATE `'.$table.'` SET '.$sqlvalues.' WHERE '.$where);
return mysql_affected_rows($this->connection);
}
public function insert($into,$values = array()) {
if(!isset($this)) {
return self::$default_instance->insert($into,$values);
}
$keys = '';
$values = '';
foreach($values as $key=>$value) {
if($keys != '') {
$keys .= ', ';
}
if($values != '') {
$values .= ', ';
}
$keys .= '`'.$key.'`';
$values .= '\''.$this->escape($value).'\'';
}
$this->query('INSERT INTO `'.$into.'` ('.$keys.') VALUES ('.$values.')');
return mysql_insert_id($this->connection);
//INSERT INTO `livphp4`.`filesystem` (`id`, `name`, `location`, `data`, `type`) VALUES (NULL, 'abcd', '0', '', 'folder');
}
private function error($id,$str) {
if(!isset($this)) {
return self::$default_instance->error($id,$str);
}
$this->last_error_id = $id;
$this->last_error_str = $str;
classerror($this);
return true;
}
public function error_id() {
if(!isset($this)) {
return self::$default_instance->error_id();
}
return $this->last_error_id;
}
public function error_str() {
if(!isset($this)) {
return self::$default_instance->error_str();
}
return $this->last_error_str;
}
}
?>
Gebruik sql::query_result_auto($query) om een lijst met data op te halen. De data wordt direct in een array gemikt.
Wel eerst een database connectie openen:
sql::set_defaults(logingegevens en databasenaam)
sql::connect();
Je kan het ook als object gebruiken:
Code (php)
1
2
3
4
5
6
2
3
4
5
6
<?
$mysql = new sql(logingegevens en database)
$regels_aan_data = $mysql->query_result_auto($query,'id');
$enkele_regel = $mysql->query_result_assoc($query);
$enkele_kolom = $mysql->query_result_int("SELECT `id` FROM `users` WHERE `username` = '".$mysql->escape($username)."'");
?>
$mysql = new sql(logingegevens en database)
$regels_aan_data = $mysql->query_result_auto($query,'id');
$enkele_regel = $mysql->query_result_assoc($query);
$enkele_kolom = $mysql->query_result_int("SELECT `id` FROM `users` WHERE `username` = '".$mysql->escape($username)."'");
?>
Indien het script je bevalt: het wordt een onderdeel van LivPHP, een groot opensource project met vele mogelijkheden met documentatie en voorbeelden.
De tijdelijke website:
http://twitter.com/LivPHP
Btw, wat jij bedoeld (ik had het een beetje verkeerd begrepen) is uit te werken met list volgens mij.
Zelf echter nooit gebruikt.
http://nl2.php.net/list
Nog een mogelijkheid:
http://nl2.php.net/manual/en/function.extract.php
Gewijzigd op 01/01/1970 01:00:00 door toby hinloopen