home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2001 August
/
PCWorld_2001-08_cd.bin
/
Komunikace
/
phptriad
/
phptriadsetup2-11.exe
/
php
/
pear
/
DB
/
tests
/
fetchrow.inc
< prev
next >
Wrap
Text File
|
2001-02-19
|
619b
|
23 lines
<?php
$dbh->setErrorHandling(PEAR_ERROR_DIE);
$dbh->query("INSERT INTO phptest VALUES(1, 'one', 'One', '2001-02-16')");
$dbh->query("INSERT INTO phptest VALUES(2, 'two', 'Two', '2001-02-15')");
$dbh->query("INSERT INTO phptest VALUES(3, 'three', 'Three', '2001-02-14')");
print "testing fetchrow:\n";
$sth = $dbh->query("SELECT * FROM phptest");
for ($i = 1; $i <= 5; $i++) {
print "row $i: ";
$row = $sth->fetchRow();
if (is_array($row)) {
print implode(", ", $row) . "\n";
} else {
var_dump($row);
}
}
$dbh->query("DELETE FROM phptest WHERE a <> 42");
?>