Jump to content

Just won't fetch data from database!


Sami

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...