I'm sort of new to php, and I need help improving my code.
I'm trying to create a program that will determine if the data already exist in the postgresql database, and i cant make it to work. I have a field "usrname" in my table
$query=pg_exec($connect,"SELECT * from dialup where usrname='$usrnme');
//"$usrnme" is the variable from a html form//
$result=pg_result($query,0,urname);
if($result==$usrnme){
echo "data already exists";
I'm trying to create a program that will determine if the data already exist in the postgresql database, and i cant make it to work. I have a field "usrname" in my table
$query=pg_exec($connect,"SELECT * from dialup where usrname='$usrnme');
//"$usrnme" is the variable from a html form//
$result=pg_result($query,0,urname);
if($result==$usrnme){
echo "data already exists";