Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // make a Query
- // make suer you include set page
- include "set.php";
- // display the page
- // a part of the page
- $tpl->display('pagename'); // without extension
- #describe $tpl
- // $tpl is an object
- // display(); is the method
- # -> is for connection
- #main functoions in tpl object
- # database functions
- // $db // object
- // $db->Query(sql statement);
- // return Query object
- // usage
- $query = $db->query($sql);
- if($query)
- echo true;
- else
- echo false;
- // main what we do is
- while($row = $query->fetch_assoc())
- {
- }
- // same as
- while($row= mysql_fetch_assoc($query))
- {
- //do codes
- }
- //object way
- $num = $query->num_rows;
- //same as
- $num = mysql_num_rows($query);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement