<?php 
include 'dbconnect.php';
$query="select * from pnmsg;";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
    $msgs=$row[0];
}

echo $msg;
include 'dbclose.php';

?>

THis is my code and am working in my local machine it give the same error Anybody help .
I could not find any mistake in my code

Check if you have specified the correct username, password, database name and host address in dbconnect.php . (Maybe it still has local settings).

THank you very much bro.
I misspelt the dbname in dbconnect.php
Thank you very much once again

You are welcome! Cheers! :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.