471,061 Members | 1,676 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,061 software developers and data experts.

connection to databse

Connectvars.php has this
// 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'
//am using this to connect to database

$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";
Jun 4 '12 #1
1 1762
1,044 Expert 1GB
You are missing a 'mysql_connect()'.....?
Jun 9 '12 #2

Post your reply

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

Similar topics

4 posts views Thread by Mahesh D. Rane | last post: by
11 posts views Thread by sreenivasan alakappan | last post: by
2 posts views Thread by Dark_AvEnGer | last post: by
1 post views Thread by Atif Jalal | last post: by
1 post views Thread by Mr. Murad Jamal | last post: by
1 post views Thread by Horia Demian | last post: by
4 posts views Thread by =?Utf-8?B?RFNJU3VwcG9ydA==?= | last post: by

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.