Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php connect to postgresql

<?php
    $db_connection = pg_connect("host=localhost dbname=dbname user=username password=password");
	$result = pg_query($db_connection, "SELECT lastname FROM employees");
?>
<?php  // with PDO
    $myPDO = new PDO('pgsql:host=localhost;dbname=dbname', 'username', 'password');
	$result = $myPDO->query("SELECT lastname FROM employees");
?>
Comment

PREVIOUS NEXT
Code Example
Php :: php replace space with dash 
Php :: php average from array 
Php :: wpml get translated post id 
Php :: laravel check if in production 
Php :: var_dump _post php 
Php :: Laravel get only the Ids of an eloquent arrays 
Php :: laravel request url 
Php :: php add element to array first position 
Php :: enqueue font awesome wordpress 
Php :: order alphabetically wp php 
Php :: php set timezone italy 
Php :: get_user_meta 
Php :: laravel carbon today date format 
Php :: Unable to locate publishable resources. Publishing complete. 
Php :: php current file name 
Php :: laravel request validate audio 
Php :: carbon add minutes 
Php :: get data in orderby in laravel 
Php :: comment supprimer balise script hmtl en php regex 
Php :: php mysqli connection check 
Php :: php file_get_contents url 
Php :: wordpress https too many redirects 
Php :: max execution time exceeded php 
Php :: drupal 8 get taxonomy terms by vocabulary name 
Php :: how to use bootstrap in laravel 8 remove tailwind 
Php :: phpMyAdmin is not able to cache templates 
Php :: php check if json 
Php :: switch between php version ubuntu nginx 
Php :: laravel number add 0 before 
Php :: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =