Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'bbcode.php';
- class Prisijungimas {
- var $host;
- var $username;
- var $password;
- var $db;
- function connect(){
- $con = mysql_connect($this->host, $this->username, $this->password)or die (mysql_error());
- mysql_select_db($this->db, $con)or die (mysql_error());
- mysql_set_charset('UTF8');
- }
- function BodyGet(){
- $sql = "SELECT * FROM tvs_content ORDER BY id DESC";
- $res = mysql_query($sql)or die (mysql_error());
- while($row = mysql_fetch_assoc($res)){
- echo '' . $row['body'] . '';
- }
- }
- function IdGet(){
- $sql = "SELECT * FROM tvs_content ORDER BY id DESC";
- $res = mysql_query($sql)or die (mysql_error());
- while($row = mysql_fetch_assoc($res)){
- echo '' . $row['id'] . '';
- }
- }
- function TitleGet(){
- $sql = "SELECT * FROM tvs_content ORDER BY id DESC";
- $res = mysql_query($sql)or die (mysql_error());
- while($row = mysql_fetch_assoc($res)){
- echo '' . $row['title'] . '';
- }
- }
- function Gavimas(){
- $sql = "SELECT * FROM tvs_content ORDER BY id DESC";
- $res = mysql_query($sql)or die (mysql_error());
- while($row = mysql_fetch_assoc($res)){
- echo '<div class="npavadinimas">'. convert_bbcodes( $row['title'] ). '</div>';
- echo '<div class="nturinys">'. convert_bbcodes( $row['body'] ). '</div>';
- }
- }
- function EilesGavimas(){
- $sql = "SELECT * FROM tvs_content ORDER BY id DESC";
- $res = mysql_query($sql)or die (mysql_error());
- while($row = mysql_fetch_assoc($res)){
- echo '<span style="color:red">' . $row['id'] . '</span> . <span style="color:black">' . $row['title'] . '</span><br/>';
- }
- }
- } //Pabaiga
- $obj = new Prisijungimas();
- $obj->host = 'localhost';
- $obj->username = 'root';
- $obj->password = '';
- $obj->db = 'lvlifetvs';
- $obj->connect();
- $domain = 'localhost';
- ?>
Add Comment
Please, Sign In to add comment