Navigatie met while met 3 while loops
Ik zit met een probleem waar ik echt niet uitkom
Ik heb een tootlje gemaakt dat automatisch XML genereerd. Dat zijn meestal 1200 records.
Ik heb 3 while loops gebruikt om het te genereren. IK heb Textlinks,imglinks,flashlinks. Daarvoor zijn de drie while loops.
Nu zit ik met een probleem, telkens als ik die feeds genereer dan haalt hij 1200 xml feeds uit de database. en dat is best wel groot,
Wat ik wil is dat hij bij de 100 feeds die hij uit de DB haalt next of volgende navigeert.
Ik weet wel hoe dat gaat(heb bij tutorials hier gekeken) maar er zijn 3 while loops?
En nu kamp ik in een probleem.
Zie hier de source code
Alvast bedankt!
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
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
<?php
// dit incrementen dat zou ik denken? Zodat de variabel de records telt in WHILE.. En nu??
$n = 1;
if($_POST['Submit']) {
if(!$_POST['id']) {
echo "<script languge='javascript'> alert('Vul AUB ProgrammaID in!');</script>";
exit;
}
$begin = "<?xml version="1.0\" encoding=\"UTF-8\"?>
<adFeed adFeedVersion=\"1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"adfeeds1.xsd\">
<program programId=\"".$_POST['id']."\">";
$begin = highlight_string($begin,true);
echo $begin;
## QUERY 1 TEXTLINKS!
$query1 = mysql_query("SELECT * FROM text WHERE soort = '1'") or die("Textlink query werkt niet");
while($record1 = mysql_fetch_assoc($query1)) {
$string = "\n<text geId=\"\" geDelete=\"no\">
<generalSettings>
<title><![CDATA[".$record1['title']."]]></title>
<productUrl><![CDATA[".$record1['producturl']."]]></productUrl>
<productDescription><![CDATA[".$record1['description']."]]></productDescription>
<categories>
<category>
<categoryId>".$record1['catid']."</categoryId>
</category>
</categories>
<segments>
<segment>
<segmentId>".$record1['segementid']."</segmentId>
</segment>
</segments>
<keywords>
<keyword><![CDATA[".$record1['title']."]]></keyword>
</keywords>
</generalSettings>
<textLink><![CDATA[".$record1['textlink']."]]></textLink>
</text>";
echo highlight_string($string,true);
// increment
$n++;
if($n == 100 || $n==200 || $n==300 || $n==400 || $n==500 || $n==600 || $n==700 || $n==800 || $n==900 || $n==1000 || $n==1100 || $n==1200) {
// HIER moet next komen maar hoe??????????
}
}
## QUERY 2 FLASH BANNERS
$query2 = mysql_query("SELECT * FROM text WHERE soort = '2'") or die("Flash query werkt niet");
while($record2 = mysql_fetch_assoc($query2)) {
$string1 = "\n<flash geId=\" geDelete=\"no\">
<generalSettings>
<title><![CDATA[".$record2['title']."]]></title>
<productUrl><![CDATA[".$record2['producturl']."]]></productUrl>
<productDescription><![CDATA[".$record2['description']."]]></productDescription>
<categories>
<category>
<categoryId>".$record2['catid']."</categoryId>
</category>
</categories>
<segments>
<segment>
<segmentId>".$record2['segementid']."</segmentId>
</segment>
</segments>
</generalSettings>
<flashVersion>".$record2['flashversion']."</flashVersion>
<flashWidth>".$record2['width']."</flashWidth>
<flashHeight>".$record2['height']."</flashHeight>
<flashUrl>".$record2['flashurl']."</flashUrl>
<flashBackupUrl>".$record2['flashbackup']."</flashBackupUrl>
<flashWindowMode>Window</flashWindowMode>
<flashSupportsPopunder>yes</flashSupportsPopunder>
<flashSupportsPopup>yes</flashSupportsPopup>
<flashSupportsIframe>yes</flashSupportsIframe>
<flashSupportsJavascript>yes</flashSupportsJavascript>
<flashDynamic>no</flashDynamic>
</flash>";
echo highlight_string($string1,true);
// increment
$n++;
if($n == 100 || $n==200 || $n==300 || $n==400 || $n==500 || $n==600 || $n==700 || $n==800 || $n==900 || $n==1000 || $n==1100 || $n==1200) {
// HIER moet next komen maar hoe??????????
}
}
## QUERY 3 IMAGE BANNERS
$query3 = mysql_query("SELECT * FROM text WHERE soort = '3'") or die("IMG query werkt niet");
while($record3 = mysql_fetch_assoc($query3)) {
$string2 = "\n<image geId=\"\" geDelete=\"no\">
<generalSettings>
<title><![CDATA[".$record3['title']."]]></title>
<productUrl><![CDATA[".$record3['producturl']."]]></productUrl>
<productDescription><![CDATA[".$record3['description']."]]></productDescription>
<categories>
<category>
<categoryId>".$record3['catid']."</categoryId>
</category>
</categories>
<segments>
<segment>
<segmentId>".$record3['segementid']."</segmentId>
</segment>
</segments>
<keywords>
<keyword><![CDATA[".$record3['title']."]]></keyword>
</keywords>
</generalSettings>
<imageWidth>".$record3['width']."</imageWidth>
<imageHeight>".$record3['height']."</imageHeight>
<imageUrl>".$record3['imageurl']."</imageUrl>
<imageSupportsPopunder>yes</imageSupportsPopunder>
<imageSupportsPopup>yes</imageSupportsPopup>
<imageSupportsIframe>yes</imageSupportsIframe>
<imageSupportsJavascript>yes</imageSupportsJavascript>
</image>";
echo highlight_string($string2,true);
// increment
$n++;
if($n == 100 || $n==200 || $n==300 || $n==400 || $n==500 || $n==600 || $n==700 || $n==800 || $n==900 || $n==1000 || $n==1100 || $n==1200) {
// HIER moet next komen maar hoe??????????
}
}
}
[/code]
// dit incrementen dat zou ik denken? Zodat de variabel de records telt in WHILE.. En nu??
$n = 1;
if($_POST['Submit']) {
if(!$_POST['id']) {
echo "<script languge='javascript'> alert('Vul AUB ProgrammaID in!');</script>";
exit;
}
$begin = "<?xml version="1.0\" encoding=\"UTF-8\"?>
<adFeed adFeedVersion=\"1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"adfeeds1.xsd\">
<program programId=\"".$_POST['id']."\">";
$begin = highlight_string($begin,true);
echo $begin;
## QUERY 1 TEXTLINKS!
$query1 = mysql_query("SELECT * FROM text WHERE soort = '1'") or die("Textlink query werkt niet");
while($record1 = mysql_fetch_assoc($query1)) {
$string = "\n<text geId=\"\" geDelete=\"no\">
<generalSettings>
<title><![CDATA[".$record1['title']."]]></title>
<productUrl><![CDATA[".$record1['producturl']."]]></productUrl>
<productDescription><![CDATA[".$record1['description']."]]></productDescription>
<categories>
<category>
<categoryId>".$record1['catid']."</categoryId>
</category>
</categories>
<segments>
<segment>
<segmentId>".$record1['segementid']."</segmentId>
</segment>
</segments>
<keywords>
<keyword><![CDATA[".$record1['title']."]]></keyword>
</keywords>
</generalSettings>
<textLink><![CDATA[".$record1['textlink']."]]></textLink>
</text>";
echo highlight_string($string,true);
// increment
$n++;
if($n == 100 || $n==200 || $n==300 || $n==400 || $n==500 || $n==600 || $n==700 || $n==800 || $n==900 || $n==1000 || $n==1100 || $n==1200) {
// HIER moet next komen maar hoe??????????
}
}
## QUERY 2 FLASH BANNERS
$query2 = mysql_query("SELECT * FROM text WHERE soort = '2'") or die("Flash query werkt niet");
while($record2 = mysql_fetch_assoc($query2)) {
$string1 = "\n<flash geId=\" geDelete=\"no\">
<generalSettings>
<title><![CDATA[".$record2['title']."]]></title>
<productUrl><![CDATA[".$record2['producturl']."]]></productUrl>
<productDescription><![CDATA[".$record2['description']."]]></productDescription>
<categories>
<category>
<categoryId>".$record2['catid']."</categoryId>
</category>
</categories>
<segments>
<segment>
<segmentId>".$record2['segementid']."</segmentId>
</segment>
</segments>
</generalSettings>
<flashVersion>".$record2['flashversion']."</flashVersion>
<flashWidth>".$record2['width']."</flashWidth>
<flashHeight>".$record2['height']."</flashHeight>
<flashUrl>".$record2['flashurl']."</flashUrl>
<flashBackupUrl>".$record2['flashbackup']."</flashBackupUrl>
<flashWindowMode>Window</flashWindowMode>
<flashSupportsPopunder>yes</flashSupportsPopunder>
<flashSupportsPopup>yes</flashSupportsPopup>
<flashSupportsIframe>yes</flashSupportsIframe>
<flashSupportsJavascript>yes</flashSupportsJavascript>
<flashDynamic>no</flashDynamic>
</flash>";
echo highlight_string($string1,true);
// increment
$n++;
if($n == 100 || $n==200 || $n==300 || $n==400 || $n==500 || $n==600 || $n==700 || $n==800 || $n==900 || $n==1000 || $n==1100 || $n==1200) {
// HIER moet next komen maar hoe??????????
}
}
## QUERY 3 IMAGE BANNERS
$query3 = mysql_query("SELECT * FROM text WHERE soort = '3'") or die("IMG query werkt niet");
while($record3 = mysql_fetch_assoc($query3)) {
$string2 = "\n<image geId=\"\" geDelete=\"no\">
<generalSettings>
<title><![CDATA[".$record3['title']."]]></title>
<productUrl><![CDATA[".$record3['producturl']."]]></productUrl>
<productDescription><![CDATA[".$record3['description']."]]></productDescription>
<categories>
<category>
<categoryId>".$record3['catid']."</categoryId>
</category>
</categories>
<segments>
<segment>
<segmentId>".$record3['segementid']."</segmentId>
</segment>
</segments>
<keywords>
<keyword><![CDATA[".$record3['title']."]]></keyword>
</keywords>
</generalSettings>
<imageWidth>".$record3['width']."</imageWidth>
<imageHeight>".$record3['height']."</imageHeight>
<imageUrl>".$record3['imageurl']."</imageUrl>
<imageSupportsPopunder>yes</imageSupportsPopunder>
<imageSupportsPopup>yes</imageSupportsPopup>
<imageSupportsIframe>yes</imageSupportsIframe>
<imageSupportsJavascript>yes</imageSupportsJavascript>
</image>";
echo highlight_string($string2,true);
// increment
$n++;
if($n == 100 || $n==200 || $n==300 || $n==400 || $n==500 || $n==600 || $n==700 || $n==800 || $n==900 || $n==1000 || $n==1100 || $n==1200) {
// HIER moet next komen maar hoe??????????
}
}
}
[/code]
Gewijzigd op 01/01/1970 01:00:00 door Erwin
dus 3 keer
while($record1 = mysql_fetch_assoc($query1)) {
Pas eerst die eens aan een * scheelt heel veel tijd. Dus
$query="SELECT ding1,ding2,ding3 FROM text WHERE enz..
$results=mysql_query($query or die(mysql_error())
while($record1 = mysql_fetch_array($results)) {
dat geld voor alles waar je * gebruikt
mysql_fetch_array is sneller dan assoc volgens mij
Ik dacht juist dat het andersom was Klaasjan, Dus dat assoc sneller was dan array, maar ik kan het mis hebben ::(
Mijn Script ziet er nu zo uit:
Hoe moet mij script luiden?
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
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
<?php
## 1 = Textlink
## 2 = Flash
## 3 = IMG
$n = 1;
// ALS DE FORM GESUBMIT IS DAN VOER JE CODE UIT
if($_POST['Submit']) {
// CHECK INGEVULDE VELDEN ANDERS FOUTMELDING
if(!$_POST['id']) {
echo "<script languge='javascript'> alert('Vul AUB ProgrammaID in!');</script>";
exit;
}
// begin van de script wat niet herhaald wordt
$begin = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<adFeed adFeedVersion=\"1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"adfeeds1.xsd\">
<program programId=\"".$_POST['id']."\">";
// dit stukje output de begin en geeft kleur!
$begin = highlight_string($begin,"end");
echo $begin;
## QUERY 1 TEXTLINKS!
// NU CHECKEN WE DE SOORT BANNER ANDERS FOUTMELDING 1ST TEXTLINKS
$query1 = mysql_query("SELECT title,producturl,textlink,imageurl,description,width,height,flashurl,flashbackup,flashversion,catid,segementid,soort FROM text WHERE soort = '1'LIMIT 0,100") or die("Textlink query werkt niet");
while($record1 = mysql_fetch_array($query1)) {
$string = "\n<text geId=\"\" geDelete=\"no\">
<generalSettings>
<title><![CDATA[".$record1['title']."]]></title>
<productUrl><![CDATA[".$record1['producturl']."]]></productUrl>
<productDescription><![CDATA[".$record1['description']."]]></productDescription>
<categories>
<category>
<categoryId>".$record1['catid']."</categoryId>
</category>
</categories>
<segments>
<segment>
<segmentId>".$record1['segementid']."</segmentId>
</segment>
</segments>
<keywords>
<keyword><![CDATA[".$record1['title']."]]></keyword>
</keywords>
</generalSettings>
<textLink><![CDATA[".$record1['textlink']."]]></textLink>
</text>";
echo highlight_string($string,"end");
$n++;
if($n == 100 || $n==200 || $n==300 || $n==400 || $n==500 || $n==600 || $n==700 || $n==800 || $n==900 || $n==1000 || $n==1100 || $n==1200) {
echo "\n</program>\n </adFeed><p> tot ".$n." <hr><p>
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<adFeed adFeedVersion=\"1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"adfeeds1.xsd\">
<program programId=\"".$_POST['id']."\">";
}
}
## QUERY 2 FLASH BANNERS
// DE 2DE FLASH
$query2 = mysql_query("SELECT title,producturl,textlink,imageurl,description,width,height,flashurl,flashbackup,flashversion,catid,segementid,soort FROM text WHERE soort = '2' LIMIT 0,100 ") or die("Flash query werkt niet");
while($record2 = mysql_fetch_array($query2)) {
// andere xml feed! VAN FLASH!!
$string1 = "\n<flash geId=\" geDelete=\"no\">
<generalSettings>
<title><![CDATA[".$record2['title']."]]></title>
<productUrl><![CDATA[".$record2['producturl']."]]></productUrl>
<productDescription><![CDATA[".$record2['description']."]]></productDescription>
<categories>
<category>
<categoryId>".$record2['catid']."</categoryId>
</category>
</categories>
<segments>
<segment>
<segmentId>".$record2['segementid']."</segmentId>
</segment>
</segments>
</generalSettings>
<flashVersion>".$record2['flashversion']."</flashVersion>
<flashWidth>".$record2['width']."</flashWidth>
<flashHeight>".$record2['height']."</flashHeight>
<flashUrl>".$record2['flashurl']."</flashUrl>
<flashBackupUrl>".$record2['flashbackup']."</flashBackupUrl>
<flashWindowMode>Window</flashWindowMode>
<flashSupportsPopunder>yes</flashSupportsPopunder>
<flashSupportsPopup>yes</flashSupportsPopup>
<flashSupportsIframe>yes</flashSupportsIframe>
<flashSupportsJavascript>yes</flashSupportsJavascript>
<flashDynamic>no</flashDynamic>
</flash>";
echo highlight_string($string1,"end");
$n++;
if($n == 100 || $n==200 || $n==300 || $n==400 || $n==500 || $n==600 || $n==700 || $n==800 || $n==900 || $n==1000 || $n==1100 || $n==1200) {
echo "\n</program>\n </adFeed><p> tot ".$n." <hr><p>
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<adFeed adFeedVersion=\"1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"adfeeds1.xsd\">
<program programId=\"".$_POST['id']."\">";
}
}
## QUERY 3 IMAGE BANNERS
// NU CHECKEN WE DE SOORT BANNER ANDERS FOUTMELDING
$query3 = mysql_query("SELECT title,producturl,textlink,imageurl,description,width,height,flashurl,flashbackup,flashversion,catid,segementid,soort FROM text WHERE soort = '3' LIMIT 0,100") or die("IMG query werkt niet");
while($record3 = mysql_fetch_array($query3)) {
// VERVOLGENS DE XML FEED VAN IMG
$string2 = "\n<image geId=\"\" geDelete=\"no\">
<generalSettings>
<title><![CDATA[".$record3['title']."]]></title>
<productUrl><![CDATA[".$record3['producturl']."]]></productUrl>
<productDescription><![CDATA[".$record3['description']."]]></productDescription>
<categories>
<category>
<categoryId>".$record3['catid']."</categoryId>
</category>
</categories>
<segments>
<segment>
<segmentId>".$record3['segementid']."</segmentId>
</segment>
</segments>
<keywords>
<keyword><![CDATA[".$record3['title']."]]></keyword>
</keywords>
</generalSettings>
<imageWidth>".$record3['width']."</imageWidth>
<imageHeight>".$record3['height']."</imageHeight>
<imageUrl>".$record3['imageurl']."</imageUrl>
<imageSupportsPopunder>yes</imageSupportsPopunder>
<imageSupportsPopup>yes</imageSupportsPopup>
<imageSupportsIframe>yes</imageSupportsIframe>
<imageSupportsJavascript>yes</imageSupportsJavascript>
</image>";
echo highlight_string($string2,"end");
$n++;
if($n == 100 || $n==200 || $n==300 || $n==400 || $n==500 || $n==600 || $n==700 || $n==800 || $n==900 || $n==1000 || $n==1100 || $n==1200) {
echo "\n</program>\n </adFeed><p> tot ".$n." <hr><p>
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<adFeed adFeedVersion=\"1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"adfeeds1.xsd\">
<program programId=\"".$_POST['id']."\">";
}
}
}
echo "\n</program>\n </adFeed>";
// end script
?>
## 1 = Textlink
## 2 = Flash
## 3 = IMG
$n = 1;
// ALS DE FORM GESUBMIT IS DAN VOER JE CODE UIT
if($_POST['Submit']) {
// CHECK INGEVULDE VELDEN ANDERS FOUTMELDING
if(!$_POST['id']) {
echo "<script languge='javascript'> alert('Vul AUB ProgrammaID in!');</script>";
exit;
}
// begin van de script wat niet herhaald wordt
$begin = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<adFeed adFeedVersion=\"1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"adfeeds1.xsd\">
<program programId=\"".$_POST['id']."\">";
// dit stukje output de begin en geeft kleur!
$begin = highlight_string($begin,"end");
echo $begin;
## QUERY 1 TEXTLINKS!
// NU CHECKEN WE DE SOORT BANNER ANDERS FOUTMELDING 1ST TEXTLINKS
$query1 = mysql_query("SELECT title,producturl,textlink,imageurl,description,width,height,flashurl,flashbackup,flashversion,catid,segementid,soort FROM text WHERE soort = '1'LIMIT 0,100") or die("Textlink query werkt niet");
while($record1 = mysql_fetch_array($query1)) {
$string = "\n<text geId=\"\" geDelete=\"no\">
<generalSettings>
<title><![CDATA[".$record1['title']."]]></title>
<productUrl><![CDATA[".$record1['producturl']."]]></productUrl>
<productDescription><![CDATA[".$record1['description']."]]></productDescription>
<categories>
<category>
<categoryId>".$record1['catid']."</categoryId>
</category>
</categories>
<segments>
<segment>
<segmentId>".$record1['segementid']."</segmentId>
</segment>
</segments>
<keywords>
<keyword><![CDATA[".$record1['title']."]]></keyword>
</keywords>
</generalSettings>
<textLink><![CDATA[".$record1['textlink']."]]></textLink>
</text>";
echo highlight_string($string,"end");
$n++;
if($n == 100 || $n==200 || $n==300 || $n==400 || $n==500 || $n==600 || $n==700 || $n==800 || $n==900 || $n==1000 || $n==1100 || $n==1200) {
echo "\n</program>\n </adFeed><p> tot ".$n." <hr><p>
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<adFeed adFeedVersion=\"1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"adfeeds1.xsd\">
<program programId=\"".$_POST['id']."\">";
}
}
## QUERY 2 FLASH BANNERS
// DE 2DE FLASH
$query2 = mysql_query("SELECT title,producturl,textlink,imageurl,description,width,height,flashurl,flashbackup,flashversion,catid,segementid,soort FROM text WHERE soort = '2' LIMIT 0,100 ") or die("Flash query werkt niet");
while($record2 = mysql_fetch_array($query2)) {
// andere xml feed! VAN FLASH!!
$string1 = "\n<flash geId=\" geDelete=\"no\">
<generalSettings>
<title><![CDATA[".$record2['title']."]]></title>
<productUrl><![CDATA[".$record2['producturl']."]]></productUrl>
<productDescription><![CDATA[".$record2['description']."]]></productDescription>
<categories>
<category>
<categoryId>".$record2['catid']."</categoryId>
</category>
</categories>
<segments>
<segment>
<segmentId>".$record2['segementid']."</segmentId>
</segment>
</segments>
</generalSettings>
<flashVersion>".$record2['flashversion']."</flashVersion>
<flashWidth>".$record2['width']."</flashWidth>
<flashHeight>".$record2['height']."</flashHeight>
<flashUrl>".$record2['flashurl']."</flashUrl>
<flashBackupUrl>".$record2['flashbackup']."</flashBackupUrl>
<flashWindowMode>Window</flashWindowMode>
<flashSupportsPopunder>yes</flashSupportsPopunder>
<flashSupportsPopup>yes</flashSupportsPopup>
<flashSupportsIframe>yes</flashSupportsIframe>
<flashSupportsJavascript>yes</flashSupportsJavascript>
<flashDynamic>no</flashDynamic>
</flash>";
echo highlight_string($string1,"end");
$n++;
if($n == 100 || $n==200 || $n==300 || $n==400 || $n==500 || $n==600 || $n==700 || $n==800 || $n==900 || $n==1000 || $n==1100 || $n==1200) {
echo "\n</program>\n </adFeed><p> tot ".$n." <hr><p>
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<adFeed adFeedVersion=\"1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"adfeeds1.xsd\">
<program programId=\"".$_POST['id']."\">";
}
}
## QUERY 3 IMAGE BANNERS
// NU CHECKEN WE DE SOORT BANNER ANDERS FOUTMELDING
$query3 = mysql_query("SELECT title,producturl,textlink,imageurl,description,width,height,flashurl,flashbackup,flashversion,catid,segementid,soort FROM text WHERE soort = '3' LIMIT 0,100") or die("IMG query werkt niet");
while($record3 = mysql_fetch_array($query3)) {
// VERVOLGENS DE XML FEED VAN IMG
$string2 = "\n<image geId=\"\" geDelete=\"no\">
<generalSettings>
<title><![CDATA[".$record3['title']."]]></title>
<productUrl><![CDATA[".$record3['producturl']."]]></productUrl>
<productDescription><![CDATA[".$record3['description']."]]></productDescription>
<categories>
<category>
<categoryId>".$record3['catid']."</categoryId>
</category>
</categories>
<segments>
<segment>
<segmentId>".$record3['segementid']."</segmentId>
</segment>
</segments>
<keywords>
<keyword><![CDATA[".$record3['title']."]]></keyword>
</keywords>
</generalSettings>
<imageWidth>".$record3['width']."</imageWidth>
<imageHeight>".$record3['height']."</imageHeight>
<imageUrl>".$record3['imageurl']."</imageUrl>
<imageSupportsPopunder>yes</imageSupportsPopunder>
<imageSupportsPopup>yes</imageSupportsPopup>
<imageSupportsIframe>yes</imageSupportsIframe>
<imageSupportsJavascript>yes</imageSupportsJavascript>
</image>";
echo highlight_string($string2,"end");
$n++;
if($n == 100 || $n==200 || $n==300 || $n==400 || $n==500 || $n==600 || $n==700 || $n==800 || $n==900 || $n==1000 || $n==1100 || $n==1200) {
echo "\n</program>\n </adFeed><p> tot ".$n." <hr><p>
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<adFeed adFeedVersion=\"1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"adfeeds1.xsd\">
<program programId=\"".$_POST['id']."\">";
}
}
}
echo "\n</program>\n </adFeed>";
// end script
?>
bedankt voor jullie hulp
array | object | assoc | row
1.04317808151 |1.35628700256 |0.750518083572 | 0.53831410408
Hieruit kan je zien dat assoc wel degelijk sneller is dan array ;)
Robert:
Stefan, volgens mij vat je dat verkeerd op.. bij mij staat er dit:
array | object | assoc | row
1.04317808151 |1.35628700256 |0.750518083572 | 0.53831410408
Hieruit kan je zien dat assoc wel degelijk sneller is dan array ;)
array | object | assoc | row
1.04317808151 |1.35628700256 |0.750518083572 | 0.53831410408
Hieruit kan je zien dat assoc wel degelijk sneller is dan array ;)
Edit:
Sorry, helemaal niet scherp van mij... je hebt het helemaal goed gezien hoor ;)
Sorry, helemaal niet scherp van mij... je hebt het helemaal goed gezien hoor ;)
kan iemand me nog helpen:P?
Wat ik vreemd vind is dat je 4 keer precies hetzelfde doet, maar alleen een andere soort in je query... Dat kan oko met een loop, waardoor je script een stuk korter en overzichtelijker wordt.