مشکل تو اسمارتی

bahy_my

Active Member
مشکل در اسمارتی
سلام
من می خوام یه قسمت از صفحه تکرار شه. می خوام یه انجین بنویسم...
اما یه مشکلی هست
این کد php هستش :
PHP:
<?php

$db=mysql_connect("localhost","root","");
mysql_select_db("data");/**/
require 'libs/Smarty.class.php';
$smarty = new Smarty;
$smarty->template_dir="template/tpl";
$smarty->config_dir="template/configs";
$smarty->compile_dir="template/compile";
$smarty->assign("title","Hello");
$query=mysql_query("select * from user");
//query
$record=mysql_fetch_array($query);
$smarty->assign('users',$record);
$smarty->display('header.tpl');
$smarty->display('index.tpl');
$smarty->display('footer.tpl');

?>

محتویات تیبل :
Bahy, 260
Arian, 6
Bahy_my, 260
Mehrarian, 32222​

فایل index.tpl :
PHP:
<strong>salam, khobi ?</strong><br />
<br />

{foreach from=$users item=users_pro}
hi {$users_pro.name}, how are you ?<br />
{$users_pro.phone}

 <br />
{/foreach}
مشکل :
خروجی به این شکله : !!!!

hi b, how are you ?
b
hi b, how are you ?
b
hi 2, how are you ?
2
hi 2, how are you ?
2​
حالا اگه .FieldName رو از آخر متغیر $users_pro بردارین به جای یک کارکتر همه ی کارکتر ها رو نشون میده اما بازم فقط یک فیلد رو می خونه.
کمک کنید لطفاً
 

جدیدترین ارسال ها

بالا