.guys please help me. i am developing an online examination system using PHP and MySQL.

.what i'm planning to do first is to create the question and answer page and it is by using looping. to be able to start i need to know first on how to fill an array with records that are saved in a database. your help will be much appreciated. thanks!

$sSQL = "select * from tblExams";
$rResult = mysql_query($sSQL);
$aExams = array();
while($aExams[] = mysql_fetch_assoc($rResult)){}

//accessing your array items (table rows)
foreach($aExams as $iIndex => $aExam)
{
echo $aExam." ".$aExam."<br/>";
}

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.