Jump to content

Just won't fetch data from database!


Sami
 Share

Recommended Posts

Warning: mysql_query() [function.mysql-query]: Access denied for user 'kristfzz'@'localhost' (using password: NO) in /home/kristfzz/public_html/index.php on line 16Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/kristfzz/public_html/index.php on line 16Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/kristfzz/public_html/index.php on line 18
1. The username I've entered is kristfzz_1, and not just kristfzz2. I've entered a password!index.php:
<?phpinclude("include/common.php");include("include/header.php");?><div id="content"><?phpif($_GET["r_http"]=="404"){?><h1>Siden kunne ikke bli funnet.</h1><?php}else{ $result = mysql_query("SELECT * FROM sites WHERE name='index'"); while($row = mysql_fetch_array($result))  {  echo $row["content"];  }}?></div><?phpinclude("include/footer.php");?>

common.php isn't importantdatabase.php

<?php// connect$con = mysql_connect("localhost","kristfzz_2","******");if (!$con)  {  die('Debugging: ' . mysql_error());  }  mysql_select_db("kristfzz_1", $con);  ?>

Link to comment
Share on other sites

It's not using that connection for whatever reason. I can't tell why from what you posted. If it says it's not using a password, it's not using a password. Those error messages indicate that it is trying to connect with default credentials.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...