473,467 Members | 1,577 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

connection to databse

1 New Member
Connectvars.php has this
<?php
// Define database connection constants
define('DB_HOST', 'localhost');
define('DB_USER', 'root');
define('DB_PASSWORD', '');
define('DB_NAME', 'el');
?>

Error: Couldn't open el: Access denied for user ''@'localhost' to database 'el'
<?php
//am using this to connect to database
require_once('./connections/connectvars.php');

$result = mysql_query( "SELECT * FROM reservation" )
or die("SELECT Error: ".mysql_error());
$num_rows = mysql_num_rows($result);
print "There are $num_rows records.<P>";
print "<table width=200 border=1>\n";
while ($get_info = mysql_fetch_row($result)){
print "<tr>\n";
foreach ($get_info as $field)
print "\t<td><font face=arial size=1/>$field</font></td>\n";
print "</tr>\n";
}
print "</table>\n";
mysql_close($link);
?>
Jun 4 '12 #1
1 1808
Luuk
1,047 Recognized Expert Top Contributor
You are missing a 'mysql_connect()'.....?
Jun 9 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Mahesh D. Rane | last post by:
Hi, I am connecting to sql databse from windows C# form. when i close the form, then also the connection to databse is active. Its not allowing me to delete the database. But if i close the...
11
by: sreenivasan alakappan | last post by:
Hello, I want to create a database applciation in C++. I am using VC++ 6.0 as the deevelopment environment. When I ever i createa project, it only allows me to create a form based normal...
2
by: Dark_AvEnGer | last post by:
hey all, i want to create a client application to connect to a MySQL server on the internet so that multiple people may access the data from around the world. Is there a simple way to do this?...
1
by: Colin Graham | last post by:
i am currently developing an asp.net web application which is linked to an Access database. The main problem that i have is in creating a global pathname that i can access. When i put my string...
1
by: Atif Jalal | last post by:
How can I share the sane databse connection between asp.net pages. I also use objects(middleware), so can I pass the same DB connection when I instantiate the object by calling its constructor?
1
by: Mr. Murad Jamal | last post by:
hi .. i have an error in this simple scenario: i drag the log in control in asp.net 2.0 and drop it on the designer, then, I run the sample (run wihtout debugging) ! VS 2005 gives me this error: ...
1
by: Horia Demian | last post by:
I have the following code in a web form which use a connection to SQL Server 2000. I use this form to display a list of products from a table. The connection string to the database server is stored...
4
by: =?Utf-8?B?RFNJU3VwcG9ydA==?= | last post by:
Hi, I have this ASP.NET application developed with VS.NET 2003 VB.NET and deplyed on Windows 2K server IIS 5. This application uses the following: - Oracle 10G databse - MS Data Access Block...
8
by: mark_aok | last post by:
Hi all, I have a split database. Both the forms, and the tables are stored on a shared network drive (this is Access 2003). The users use the forms, and the tables on the network drive, there...
1
by: querry | last post by:
Hi all, I am developing a web application where I save a XML file into a SQL Server 2000 database. I do not face any problems in storing to xml file to the database. However, when a updated...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.