A
Anonymous
Guest
New to this forum. If this is the wrong area to post this question, please direct me to a more appropriate place.
I'm trying to code something that returns login errors. I'd like to be more specific than "something went wrong" and was hoping to use one of the pg_error* functions, but nothing returns anything. As a test, I've coded the following, which is an part of an action from a HTML form. The form gets the username and password and passes it to the script via the POST method:
$dbconn = pg_connect("dbname=<something> user=$_POST[username] password=$_POST[password] <etc...>") or
die ("Error: " . pg_last_error());
if ($dbconn == true) {
// Success message
} else {
// Failure message
}
This isn't returning anything visible to the screen. I've looked over the web for some examples but they seem pretty scarce that I can see. Maybe I'm not looking for the right thing.
Can anyone help me out on this? I'm learning both PostgreSQL and PHP at the same time and I could easily be missing something.
Thanks
I'm trying to code something that returns login errors. I'd like to be more specific than "something went wrong" and was hoping to use one of the pg_error* functions, but nothing returns anything. As a test, I've coded the following, which is an part of an action from a HTML form. The form gets the username and password and passes it to the script via the POST method:
$dbconn = pg_connect("dbname=<something> user=$_POST[username] password=$_POST[password] <etc...>") or
die ("Error: " . pg_last_error());
if ($dbconn == true) {
// Success message
} else {
// Failure message
}
This isn't returning anything visible to the screen. I've looked over the web for some examples but they seem pretty scarce that I can see. Maybe I'm not looking for the right thing.
Can anyone help me out on this? I'm learning both PostgreSQL and PHP at the same time and I could easily be missing something.
Thanks