Dobriy vecher
U menya takaya problema
Ustanovlen WAMPSERVER 2.2
PHP 5.4.3
Ya instaliroval PEAR w direktoriyu c:\wamp\bin\php\php5.4.3\pear
tam poyavilos mnogo failov i eshe odna directoriya pear gde naxodyatsa db.php, pear.php i tak dalee
V php.ini pri instalyacii dobavilas stroka - put k etoy direktorii
teper kogda ya zagrujayu rabochiy fail s wampservera - localhost
<?php
include('db_login.php');
require_once('c:/wamp/bin/php/php5.4.3/pear/pear/DB.php');
$connection = DB::connect("mysql://$db_username:$db_password@db_host/$db_database");
if (DB::isError($connection)) {
die("Oshibka podklyucheniya k baze dannix:<br/>".
DB::errorMessage($connection));
}
$query = "SELECT * from books natural join authors";
$result = $connection->query($query);
if (DB::isError($result)) {
die("Oshibka zaprosa:<br />".$query." ".DB::errorMessage($result));
}
echo('<table border="1">');
echo '<tr><th>Title</th><th>Author</th><th>Pages</th></tr >';
while ($result_row = $result->fetchRow()) {
echo "<tr><td>";
echo $result_row[1] . '</td><td>';
echo $result_row[4] . '</td><td>';
echo $result_row[2] . '</td><td>';
}
echo("</table>");
$connection->disconnect();
?>
To vidaet sleduyushee oshibki
Strict standards: Non-static method DB::connect() should not be called statically in C:\wamp\www\db_test_1.php on line 6
Strict standards: Non-static method DB::parseDSN() should not be called statically in C:\wamp\bin\php\php5.4.3\pear\pear\DB.php on line 520
Strict standards: Non-static method DB::errorMessage() should not be called statically, assuming $this from incompatible context in C:\wamp\bin\php\php5.4.3\pear\pear\DB.php on line 965
i tak dalee
Podskajite pojaluysta v chem problema?? Ogromnoe spasibo