i am new to ph and mysql and i am trying to setup a news driven web site so i can quickly and easily update my website. i followed through a tutorial and found that. it didt work bellow is the code i was trying to use .
mysql_connect('localhost','login','password');
// login into the mysql database server
mysql_select_db('mysite');
// select the site's database
$query = mysql_query('SELECT * FROM news');
// get all the news in the 'news' table
while($news = mysql_fetch_array($query)) {
echo "Title: " . $news['title'] . "n";
echo $news['text'] . "n";
echo "---------------------n";
}
ERROR MESSAGE
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/www/data122/1news.php on line 14
i would really appreciate some help if neway could recomend neway which i could get this script to work