Ok, im having a hard time understanding how to use postgresql im used to using MySQL.
And right now im trying to take some code I wrote using MySQL and port it to postgresql.
heres the code:
function checkuser( $name, $password )
{
$connect = pg_Connect("host=myHost port=myPort tty=myTTY options=myOptions dbname=myDB user=myUser password=myPassword ");
global $id;
if( ! ( $sql = mysql_query("SELECT * FROM upload WHERE name='$name'") ) )
{
return 0;
}
if ( ( $row = mysql_fetch_array( $sql ) ) && $password = $row["password"] && $password != " "
&& $password != "" && $name = $row["name"] && $id = $row["id"] )
return 1;
else
return 0;
}
//checking to see if the user was checked out
if(checkuser( $username, $userpass ) )
{
setcookie("cookie_name", $username, time() + 3600, "/", ".inetprime.net");
setcookie("cookie_password", $userpass, time() + 3600, "/", ".intetprime.net");
setcookie("cookie_id", $id, time() + 3600, "/", ".inetprime.net");
$user = $cookie_name;
header("Location: <!-- m --><a class="postlink" href="http://www.inetprime.net/gmarr/uploader/redir.php">http://www.inetprime.net/gmarr/uploader/redir.php</a><!-- m -->");
} else {
echo("<li>Your User Name and Password were not found in the Database</li>
<li>You <b>MUST</b> use the name you signed up with to login</li>
<br>");
}
If someone could tell me what to do it would be appreciated.
And right now im trying to take some code I wrote using MySQL and port it to postgresql.
heres the code:
function checkuser( $name, $password )
{
$connect = pg_Connect("host=myHost port=myPort tty=myTTY options=myOptions dbname=myDB user=myUser password=myPassword ");
global $id;
if( ! ( $sql = mysql_query("SELECT * FROM upload WHERE name='$name'") ) )
{
return 0;
}
if ( ( $row = mysql_fetch_array( $sql ) ) && $password = $row["password"] && $password != " "
&& $password != "" && $name = $row["name"] && $id = $row["id"] )
return 1;
else
return 0;
}
//checking to see if the user was checked out
if(checkuser( $username, $userpass ) )
{
setcookie("cookie_name", $username, time() + 3600, "/", ".inetprime.net");
setcookie("cookie_password", $userpass, time() + 3600, "/", ".intetprime.net");
setcookie("cookie_id", $id, time() + 3600, "/", ".inetprime.net");
$user = $cookie_name;
header("Location: <!-- m --><a class="postlink" href="http://www.inetprime.net/gmarr/uploader/redir.php">http://www.inetprime.net/gmarr/uploader/redir.php</a><!-- m -->");
} else {
echo("<li>Your User Name and Password were not found in the Database</li>
<li>You <b>MUST</b> use the name you signed up with to login</li>
<br>");
}
If someone could tell me what to do it would be appreciated.