Hello i have these codes below,
PHP codes;
Smarty codes;Code:$cid = array(); $title = array(); $email = array(); $add_date = array(); $i = 0; #$result=mysql_query("SELECT * FROM your table LIMIT $limit1, $limit2"); $query = "SELECT * FROM castingcall LIMIT $limit1, $limit2"; $result=mysql_query($query) or die("Problem with the query: $query on line " . __LINE__ . '<br>' . mysql_error()); while($row = mysql_fetch_array($result)) { $cid[$i] = $row['castingid']; $title[$i] = $row['title']; $email[$i] = $row['email']; $add_date[$i] = $row['date_posted']; echo "<b>". $cid[$i] ."</b> "; echo " ". $title[$i]; echo "<br>"; $smarty->assign('cid', $cid); $smarty->assign('title', $title); $smarty->assign('email', $email); $smarty->assign('add_date', $add_date); $i++; } $adminsmarty -> display( "modules/admin/viewparsingcalls.tpl" );
Question: Why is it i did not print the value of the array?Code:<ul> {foreach from=$cid item=foo} <li>{$foo}</li> {/foreach} </ul> <ul> {foreach from=$title item=foo} <li>{$foo}</li> {/foreach} </ul>
What is the problem with my array & foreach?
Any help please...
Thank you in advance





Bookmarks