Unable to display the data in MySql table.
Posted: Mon Jun 06, 2005 4:15 pm
Hi,
This is my first time here.
I have installed PHP 5 and MySql Server 4.1.
My web server is Apache web server and I tried connecting to MySql database.
using the following PHP code.
I am getting the following message:
Thanks in advance,
SGeorge.
JCART | Please use
This is my first time here.
I have installed PHP 5 and MySql Server 4.1.
My web server is Apache web server and I tried connecting to MySql database.
using the following PHP code.
Code: Select all
#################################################
# Purpose: DB connection test script
# Author : JG
# Date : 05/16/2005
#
#################################################
<html>
<head>
<title>
Hello world,
</title>
<head>
<body>
<?php
$username="root";
$password="***";
$database="ectdb";
$link = @mysql_connect(localhost, $username, $password)
or die('Could not connect: ' . mysql_error());
echo 'Connected successfully';
mysql_select_db($database) or die('Could not select database');
mysql_close();
echo "Database created";
?>
</body>
</html>Could anyone please tell me why I am not getting the "echo 'Connected successfully';" message.################################################# # Purpose: DB connection test script # Author : JG # Date : 05/16/2005 # #################################################
Thanks in advance,
SGeorge.
JCART | Please use
Code: Select all
tags when posting php code. Review [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color][/size]
[color=green][size=75]JCART | removed password [/size][/color]