Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //принимаем данные
- $user=$_POST['user'];
- $org=$_POST['org'];
- //соединяемся с БД
- $dbconn = pg_connect("host=localhost dbname=passport user=postgres password=Pwd000")
- or die('Could not connect: ' . pg_last_error());
- //ищем данные о введенной организации
- //SELECT name,type,id FROM orgs WHERE CAST(id AS text) LIKE '133%' ORDER BY id
- $query = 'SELECT id FROM items WHERE orgid = '.$org.'';
- echo $query;
- $result = pg_query($query) or die(pg_last_error());
- echo "<table>\n";
- while ($line = pg_fetch_array($result, null, PGSQL_ASSOC)) {
- echo "\t<tr>\n";
- foreach ($line as $col_value) {
- echo "\t\t<td>$col_value</td>\n";
- }
- echo "\t</tr>\n";
- }
- echo "</table>\n";
- // Очистка результата
- pg_free_result($result);
- // Закрытие соединения
- pg_close($dbconn);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement