Im trying to learn the foreach function, it is outputing just one of its content instead of all can you tell me why? here is my coding:
<?php require_once('../Connectio
ns/menuSen
cillo2.php
'); ?>
<?php
//////////////////////////
//////////
//////////
////////
mysql_select_db($database_
menuSencil
lo2, $menuSencillo2);
$query = "SELECT menu_name FROM textoLibro";
$Recordset1 = mysql_query($query, $menuSencillo2) or die(mysql_error());
$row = mysql_fetch_assoc($Records
et1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1
);
//////////////////////////
//////////
//////////
/////////
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml"
>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
<?php foreach($row as $listing){
echo "$listing";
}?>
</body>
</html>
<?php
mysql_free_result($Records
et1);
?>
Start Free Trial