Real programmers don't comment their code... it was hard to write, it should be hard to read!
't Is wel handig als je ook even vertelt wat de $format variabele bevat.
edit:
Overigens: ik neem aan dat je die vsprintf () wel ook in een dergelijke foreach zet?
[ Voor 44% gewijzigd door drm op 22-03-2004 16:28 ]
Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz
Ok, hier het hele stukje code, $format heeft natuurlijk ook een variabele inhoud.
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
| $planning = $this->db->db_select($query); $str = "[table]\n"; $format = "[row] [img=".IMAGE_PATH."bullet.png]bullet[/img]"; for($i=0; $i<count($fields); $i++){ //$fields bevat de velden die in de query zijn gestopt $format .= "%s | "; } $format .= "\n"; $str .= "[row] \n"; foreach ($planning as $row) { $str .= sprintf($format, $row[0], $row[1], $row[2], $row[3]); } $str .= "[/table]\n"; |
Real programmers don't comment their code... it was hard to write, it should be hard to read!
code:
1
| $str .= vsprintf($format, $row); |
Je impliceert met die code dat je het in een foreach hebt staan, aangezien je $row gebruikt. Dat moet iig niet. Verder zie ik niet wat het zou kunnen zijn...
'E's fighting in there!' he stuttered, grabbing the captain's arm.
'All by himself?' said the captain.
'No, with everyone!' shouted Nobby, hopping from one foot to the other.
'k Heb de oplossing zelf al gevonden....
$row was een MYSQL_BOTH-array
$row was een MYSQL_BOTH-array

Real programmers don't comment their code... it was hard to write, it should be hard to read!