Jump to content

p.diddle

New Members
  • Posts

    1
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

p.diddle's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi. I'm new to php and mysql. I appreciate any help getting this result into a variable... I wrote the INSERT code on another page, and it works fine. I can see it work in phpMyAdmin. Now that I'm able to create an account for someone to then login, why can't I get that result back out? I know it's probably something simple, but I can't find a tutorial that addresses mysql_result() clearly. By clearly, I mean break it down like you're talking to a 'tarded third grader. Once I can get these results to display by echoing them out on the page, I can go back to trying to compare them. <?php session_start(); include 'config.php'; include 'opendb.php'; $user = $_POST['user']; $pass = $_POST['pass']; $user = mysql_real_escape_string($user); $pass = mysql_real_escape_string($pass); $getuser =("SELECT user FROM users WHERE user=\'$user\'"); $getpass =("SELECT pass FROM users WHERE pass=\'$pass\'"); if (!$getuser) { die('Could not query getuser:' . mysql_error()); } if (!$getpass) { die('Could not query getpass:' . mysql_error()); } //I think my problem is here I tried $user_result = mysql_result($getuser, 0); //which should return the first record, right? It didn't work either... //I have also tried several variations of these //none of which have worked... $user_result = mysql_result($getuser); $pass_result = mysql_result($getpass); if (!user_result) { die('No user result'); }//if this does not stop it... if (!pass_result) { die('No pass result'); }//and this does not stop it... echo $user_result; echo $pass_result; //why don't these echo out? include 'closedb.php'; ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.