Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- header( 'Content-Type: text/html; charset=utf-8' );
- $db_hostname = "localhost";
- $db_database = "cms";
- $db_username = "root";
- $db_password = "";
- $connection = new mysqli($db_hostname,$db_username,$db_password,$db_database);
- if($connection-> connect_error) die($connection -> connect_error);
- $query = "SELECT * FROM category";
- $result = $connection -> query($query);
- if(!$result) die($connection -> connect_error);
- for($i = 0, $lenght = $result -> num_rows; $i < $lenght;$i++){
- $result -> data_seek($i);
- $row = $result -> fetch_assoc();
- echo $row['title']."<br>";
- }
- $result -> close();
- $connection->set_charset("utf8");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement