![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 162 Pomógł: 2 Dołączył: 18.01.2008 Ostrzeżenie: (0%) ![]() ![]() |
Mam sobie kod
Kod <?php require_once 'PHPTAL.php'; $template = new PHPTAL('templates/default/index.tpl'); $connect = mysql_connect('', '', ''); $db = mysql_select_db('baza'); $query = "SELECT name, phone FROM user"; $result = mysql_query($query) or die(mysql_error()); $result_new = array(); while($row = mysql_fetch_assoc($result)) { $result_new[] = $row; } $template->result = $result_new; try { echo $template->execute(); } catch (Exception $e){ echo $e; } ?> Moje pytanie, Czy da się jakoś lepiej przekazać dane z bazy do zmiennej : $template->result (np żeby nie używać pętli) ? |
|
|
![]() ![]() |
![]() |
Aktualny czas: 19.08.2025 - 18:41 |