Forum Moderators: coopster

Message Too Old, No Replies

mysql fetch array

         

Malatang

7:24 pm on Apr 25, 2009 (gmt 0)

10+ Year Member



Hello everyone,
I am learing PHP and I am having a hard time figuring this out.

I have written a script to connect to a MySql database and I am making a query and returing a result. This works just fine. the problem I am haivng is, I want to output the results to html.

while($row = mysql_fetch_array( $rs ))
{
echo ("<b>" .$row["PostTitle"] ."</b><br /> Date Posted: " .$row["NewDate"] . "<br /> <hr>");
echo ($row["PostText"]."<br /> <hr>");
}

Instead of echoing I want to echo the results here:

<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<?php echo here instead ?>
</body>
</html>

Any help would be appricated.

Malatang

7:35 pm on Apr 25, 2009 (gmt 0)

10+ Year Member



nevermind I figured it out thanks

dreamcatcher

8:37 am on Apr 26, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Malatang, welcome to WebmasterWorld. :)

Glad you got yourself sorted.

dc