MySQL/Apache Error in PHP MySQL query

Mar 12, 2012   //   by phpfreelancer.biz   //   Blog, MySQL Tutorial  //  No Comments

I am getting the following error:

Access denied for user ‘apache’@’localhost’ (using password: NO)

Here’s the code:


<?php 

include("../includes/connect.php");

$query = "SELECT * from story";

$result = mysql_query($query) or die(mysql_error());

echo "<h1>Delete Story</h1>";

if (mysql_num_rows($result) > 0)

{

while($row = mysql_fetch_row($result))

  {

echo '<strong>'.$row[1].'</strong><span><a href="../process/delete_story.php?id='.$row[0].'">Delete</a></span>';

echo '

<em>'.$row[2].'</em>';


    }

}

else {


   echo "No stories available.";


} ?>


Leave a comment

Share This Post

RSS Wordpress News