Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'login.php';
- $db_server = pg_connect(host=$db_hostname, port=$db_port, user=$db_username, password=$db_password);
- if(!$db_server) die("Unable to connect: " . pg_error());
- pg_select_db($db_database)
- or die("Unable to select database: " . pg_error());
- $query = "SELECT * FROM CSGames";
- $result = pg_query($query);
- if (!result) die ("Database access failed: " . pg_error());
- $rows = pg_num_rows($result);
- for ($j = 0 ; $j < $rows ; ++$j)
- {
- $row = pg_fetch_row($result);
- echo 'Title: ' . $row[0] . '<br / >';
- echo 'Platform: ' . $row[1] . '<br / >';
- echo 'Description: ' . $row[2] . '<br / >';
- echo 'Price: ' . $row[3] . '<br / ><br / >';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement