Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2002

    Unanswered: Simple MySQL record display

    First of I'm sorry for such a simple question, I looked around but all the answers I found were more complex then I thought were neccessery.

    My question is as follows:

    I am trying to take a simple form field and use the variable in a MySQL query.


    $user_id = $_POST["rdo_UserID"]
    $open_db = mysql_pconnect("localhost", "root", "password", "mydb");

    $query = mysql_query("select UserName FROM auth WHERE UserID = 'user_id'");

    echo "$query[UserName]"; <------------- Line in question

    Now I know you can pump the results of a query into an arrary and loop through the array and wront out the data in that fashion, but in this case I just want one piece of information displayed.

    Is there a way to state that I ONLY want the one vaule from the table that I have selected? Something like my: echo $query[UserName] statment?

    Thank you in advance,

  2. #2
    Join Date
    Aug 2002
    I actually found my solution.

    Thanks any ways,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts