You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a test postgresql database create a table like such:
create table foo ( bar text );
The following code:
<?phpfunctionfee(&$a){}
$a = ["bar"=>"testing"];
$db = pg_connect('dbname=test host=localhost');
pg_insert($db, 'foo', $a); //No error$res = pg_query($db, "select * from foo");
var_dump(pg_fetch_all($res)); // Output is a single tuple with the field foo is "testing"fee($a["bar"]);
pg_insert($db, 'foo', $a); //Error: pg_insert(): Expects NULL, string, long or double value for PostgreSQL 'text' (bar)