I am trying to have all my common files in one location called Common.
The code is:
<?php
// Include the MySQL class
include '/Common/MySQL.php';
$host='localhost'; // Hostname of MySQL server
$dbUser='kamac'; // Username for MySQL
$dbPass='websmurf'; // Password for user
$dbName='sitepoint'; // Database name
// Connect to MySQL
$db = &new MySQL($host,$dbUser,$dbPass,$dbName);
echo 'connected'
?>
When I run this I get the error:
Warning: main(/Common/MySQL.php): failed to open stream: No such file or directory in E:\IntraNetData\php\sitepointExamples\PHPAnthologyCode\PHPandMySQL\3K.php on line 5
Warning: main(): Failed opening '/Common/MySQL.php' for inclusion (include_path='.;c:\php4\pear') in E:\IntraNetData\php\sitepointExamples\PHPAnthologyCode\PHPandMySQL\3K.php on line 5
Fatal error: Cannot instantiate non-existent class: mysql in E:\IntraNetData\php\sitepointExamples\PHPAnthologyCode\PHPandMySQL\3K.php on line 15
Can anyone tell me where I am going wrong ? I can include the file on the same location as the source file without problems.
The code is:
<?php
// Include the MySQL class
include '/Common/MySQL.php';
$host='localhost'; // Hostname of MySQL server
$dbUser='kamac'; // Username for MySQL
$dbPass='websmurf'; // Password for user
$dbName='sitepoint'; // Database name
// Connect to MySQL
$db = &new MySQL($host,$dbUser,$dbPass,$dbName);
echo 'connected'
?>
When I run this I get the error:
Warning: main(/Common/MySQL.php): failed to open stream: No such file or directory in E:\IntraNetData\php\sitepointExamples\PHPAnthologyCode\PHPandMySQL\3K.php on line 5
Warning: main(): Failed opening '/Common/MySQL.php' for inclusion (include_path='.;c:\php4\pear') in E:\IntraNetData\php\sitepointExamples\PHPAnthologyCode\PHPandMySQL\3K.php on line 5
Fatal error: Cannot instantiate non-existent class: mysql in E:\IntraNetData\php\sitepointExamples\PHPAnthologyCode\PHPandMySQL\3K.php on line 15
Can anyone tell me where I am going wrong ? I can include the file on the same location as the source file without problems.