php - No PostgreSQL link opened yet -
i completly new databases , trying make simple query postgresql database. problem don't understand how things work. in index.php
$dbconn = pg_connect("host=myhost port=5432 dbname=mydbname user=myuser password=mypass sslmode=require options='--client_encoding=utf8'") or die('could not connect: ' . pg_last_error());
and connected database. when try query myphp.php
$query = "insert public.account_recover_users values ($mykey,$email,$name)"; $result = pg_query($query);
i error in title description. proper way connect database can access other files index.php well?
p.s. $mykey,$email,$name
3 variables containing key (randomly-generated), email , name.
Comments
Post a Comment