I have a problem. I created a table in mysql database and have the following script as .php file but i get always the same error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/guntmar/public_html/indexmain.php on line 147
Can anyone please help me???
Thank you!!
Below is the code of the file...
<?php require_once('Connections/Login.php'); ?>
<?php
mysql_select_db($database_Login, $Login);
$query_Recordset1 = "SELECT * FROM quotes";
$Recordset1 = mysql_query($query_Recordset1, $Login) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
<?php
define ('HOSTNAME', 'localhost_or_hostname');
define ('USERNAME', 'username');
define ('PASSWORD', 'database_password');
define ('DATABASE_NAME', 'database_name');
mysql_select_db(DATABASE_NAME);
$query = "SELECT entry_title,entry_text FROM mt_entry WHERE (entry_blog_id=1) and (entry_status=2) ORDER by rand() LIMIT 1";
($result = mysql_query($query));
while ($row = mysql_fetch_array($result)) {
echo "<p>" , ($row['entry_title']) , "</p> \n <p>" , nl2br($row['entry_text']) , "</p>";
}
mysql_close();
?>