Error connecting to MySQL Database
| From: | Yosvel Reyes | Date: | Mon, 27 Oct 2003 15:30:42 +0000 |
| Subject: | Error connecting to MySQL Database | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-21888@lists.php.net to get a copy of this message | ||
Hi All:
I'm a PHP beginner and just I am trying to connect using PHP to a MySQL
Database with the following code
<?php
$Connection = mysql_connect("server", "login", "pwd");
if($Connection == TRUE){
//I am connected to the data base...
$id = mysql_query("select * from publication");
if($id != FALSE){
//now fetch the results...
while(($result = mysql_fetch_row($id))){
echo $result[0];
echo " --- ";
echo $result[1];
echo " --- ";
echo $result[2];
echo "<br/>";
}
}
else{
echo "Cant execute the SQL statement";
}
}
else
echo "Cant connect to database";
?>
and when I try to execute this code got the following error:
Fatal error: Call to undefined function: mysql_connect() in C:\Program
Files\Apache Group\Apache2\htdocs\Yosvel\TMP4oqwenf8u5.php on line 27
I Assume that there must be an error on my PHP installation or I have to
include some other php file
Any suggestion???
Thanks in advance...
==========================================
Lic. Yosvel Reyes Fonfria
khronos@fastmail.fm
tel: (053)42 205428
Who try and try again, triumph!!!
==========================================
--
http://www.fastmail.fm - A no graphics, no pop-ups email
service