Jump to content

while loop & mysql_fetch_array not working


undertaker333

Recommended Posts

why it giving me single row record only... while loop is not working please help me..

 

<?php

$comments= "";

$sql= "SELECT * FROM comment";

$result = mysql_query($sql);

while($row = mysql_fetch_array($result))

  { $serials= $row['serial'];

$names= $row['name'];

$emails= $row['email'];

$msges= $row['msg'];

$date_added= $row['date'];

$comments= "$names <br /> $msges <br /> $date_added";

}

 

?>

I also try thiss...

<?php
$comments= "";
$result = mysql_query("SELECT * FROM comment");
while($row = mysql_fetch_array($result))
  {			$serials= $row['serial'];
		$names= $row['name'];
		$emails= $row['email'];
		$msges= $row['msg'];
		$date_added= $row['date'];
		$comments= "$names <br /> $msges <br /> $date_added";
		}

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.