Hello, I have been trying to show some texts that is stored in mysql in a textarea on a random basis with no luck.
Here is my code:
[php]<?php
mysql_connect(“localhost”, “myusername”, “mypass”) or die(“Connection Failed”);
mysql_select_db(“mydatabase”)or die(“Connection Failed”);
$query1 = (“SELECT name FROM advertising”);
$result1 = @mysql_query ($query1) or die (mysql_error());
$data = mysql_fetch_assoc($result1);
while($row = mysql_fetch_array($query)){
$name = $row["name"];
}
?>
<?php echo "$namet"; ?>
[/php]
and when I run the code I get this error and also nothing shows in the textarea:
Warning: mysql_fetch_array() expects parameter 1 to be resource, null given in /home/path…/public_html/display.php on line 9
could someone please help me?
Thanks