hey guys what is wrong with my mysql_fetch_array
here is my code :

<table width="400" border="0" align="center" cellpadding="3" cellspacing="0">
<strong><h2>Welcome to Our Website</h2></strong>
<br />
$mysql_host = "localhost";
$mysql_database = "members";
$tbl_name = "posts";
mysql_connect('localhost','admin','*******')or die("can not connnect to database");
mysql_select_db("$mysql_database")or die("sorry , can not sellect db");
$sql="SELECT*FROM $tbl_name";
while($rows = mysql_fetch_array("$result"))
<table width="400" border="0" cellpadding="0" cellspacing="1" bgcolor="#cccccc">
<table width="400" border="0" cellpadding="2" cellspacing="1" bgcolor="#ffffff">
<td>Title : <? echo $rows['title']; ?></td>
<td> <?   echo $rows['post']; ?> </td>
</table></td></tr> <? } ?></table>
<? mysql_close(); ?>

and here is the error :

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /www/zxq.net/a/w/a/awah/htdocs/add_email_test/admin/view-posts.php on line 19


Remove the double quotes. It expects a variable containing a resource, not a string.


while($rows = mysql_fetch_array($result))
$sql="SELECT * FROM $tbl_name";


while($rows = mysql_fetch_array($result))

replace with above code and try