|
Posted by gmac63 on 05/09/06 23:16
To be brief, I have never encountered this where I make a database
query:
<?php
$db = sqlite_open('tc.db');
$result = sqlite_query($db,"select dir,app,protocol,sport,dport,mark
from iptmarkView");
$row = sqlite_fetch_array($result);
while ($row = sqlite_fetch_array($result)){
print "Direction: $row[dir]\n<br>";
print "Application: $row[app]\n<br>";
print "\n<br>";
};
// No problem so far ... but if I want to print the rest (I have a
reason)...
while ($row = sqlite_fetch_array($result)){
print "Protocol: $row[protocol]\n<br>";
print "Source Port: $row[sport]\n<br>";
print "Destination Port: $row[dport]\n<br>";
print "Mark: $row[mark]\n<br>";
print "\n<br>";
};
?>
.... it doesn't want to print the second while() loop unless I do the
query again:
<?php
$db = sqlite_open('tc.db');
$result = sqlite_query($db,"select dir,app,protocol,sport,dport,mark
from iptmarkView");
$row = sqlite_fetch_array($result);
while ($row = sqlite_fetch_array($result)){
print "Direction: $row[dir]\n<br>";
print "Application: $row[app]\n<br>";
print "\n<br>";
};
$db = sqlite_open('tc.db');
$result = sqlite_query($db,"select dir,app,protocol,sport,dport,mark
from iptmarkView");
$row = sqlite_fetch_array($result);
while ($row = sqlite_fetch_array($result)){
print "Protocol: $row[protocol]\n<br>";
print "Source Port: $row[sport]\n<br>";
print "Destination Port: $row[dport]\n<br>";
print "Mark: $row[mark]\n<br>";
print "\n<br>";
};
?>
Why? It has to be quite simple, just never run into this before.
thx
-Wes Yates
Navigation:
[Reply to this message]
|