RadioActive Posted February 4, 2008 Report Share Posted February 4, 2008 Sarakstīju šādu te. include_once('include/bTemplate.php'); include('config.php'); $settings = mysql_query("SELECT title FROM settings"); $tests = "asd"; $tpl = new bTemplate(); $tpl ->set('title', $settings); $tpl ->set('tests', $settings); echo $tpl ->fetch('theme.tpl'); Itkā pēc w3school viss ir pareizi. Tikai es nesaprotu kapēc viņš izvada Resource id #6, bet datubāze rakstīts kas cits. Link to comment Share on other sites More sharing options...
Lynx Posted February 4, 2008 Report Share Posted February 4, 2008 $settings pašlaik tev vēl ir querija resource objekts. Lai izvilktu datus tev jāveic datu atgriešana no querija. Es vienas vērtības atgriešanai izmantoju šādu variantu: $query = mysql_query('SELECT title FROM settings'); list($settings) = mysql_fetch_row($query); Link to comment Share on other sites More sharing options...
RadioActive Posted February 4, 2008 Author Report Share Posted February 4, 2008 Paldies sapratu. Link to comment Share on other sites More sharing options...
Paulinjsh Posted February 5, 2008 Report Share Posted February 5, 2008 vēl variants mysql_result(mysql_query("SELECT ..."), 0, 0); Link to comment Share on other sites More sharing options...
Recommended Posts