amanyasin
Technical User
- Feb 7, 2003
- 28
Dear all,
i want to connect Mysql through PEAR DB. i installed PHP5.2.2 with all extensions.when i run fallowing php code,
<?php
// connect
require_once('DB.php');
$db = DB::connect("mysql://root:123@localhost/test");
if (DB::iserror($db)) {
die($db->getMessage( ));
}
// issue the query
$sql = "SELECT * from items";
$q = $db->query($sql);
if (DB::iserror($q)) {
die($q->getMessage( ));
}
// generate the table
while ($q->fetchInto($row)) {
?>
<tr><td><?= $row[0] ?></td>
<td><?= $row[1] ?></td>
<td><?= $row[2] ?></td>
</tr>
<?php
}
?>
It shows an error that " DB.PHP FILE NOT FOUND AT PATH ....... ".
i copied DB.PHP file in PEAR folder then it shows fallowing error msg's.
1- Debug Strict (PHP 5): C:\Program Files\PHP\PEAR\DB.php line 470 - Assigning the return value of new by reference is deprecated.
2- Debug Error: C:\Program Files\PHP\PEAR\DB.php line 946 - Class 'PEAR_Error' not found
And it print the whole DB.PHP file in browser like TXT file.
please guide me, thanks
i want to connect Mysql through PEAR DB. i installed PHP5.2.2 with all extensions.when i run fallowing php code,
<?php
// connect
require_once('DB.php');
$db = DB::connect("mysql://root:123@localhost/test");
if (DB::iserror($db)) {
die($db->getMessage( ));
}
// issue the query
$sql = "SELECT * from items";
$q = $db->query($sql);
if (DB::iserror($q)) {
die($q->getMessage( ));
}
// generate the table
while ($q->fetchInto($row)) {
?>
<tr><td><?= $row[0] ?></td>
<td><?= $row[1] ?></td>
<td><?= $row[2] ?></td>
</tr>
<?php
}
?>
It shows an error that " DB.PHP FILE NOT FOUND AT PATH ....... ".
i copied DB.PHP file in PEAR folder then it shows fallowing error msg's.
1- Debug Strict (PHP 5): C:\Program Files\PHP\PEAR\DB.php line 470 - Assigning the return value of new by reference is deprecated.
2- Debug Error: C:\Program Files\PHP\PEAR\DB.php line 946 - Class 'PEAR_Error' not found
And it print the whole DB.PHP file in browser like TXT file.
please guide me, thanks