SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    $postcount++; koomann's Avatar
    Join Date
    Feb 2003
    Location
    Posts
    428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MySQL Data Not Selecting?

    PHP Code:
    <?php
    include("accesscontrol.php" ); 
    include(
    "common.php" );
    include(
    "db.php" );
    dbConnect("star-craftx_com" );
    $sql "SELECT FROM design_users WHERE
    username='
    $username' AND password='$password' AND aim='$aim' AND email='$email' date_joined='$date_joined'";

    $date_joined date("M d, Y h:i A""$date_joined);
    echo 
    "Welcome<b> $username</b>.<br>";
    echo 
    "You registered on:<b> $date_joined </b><br>";
    echo 
    "<b>Contact Info:</b><blockquote><br>";
    echo 
    "<b>AIM:</b> $aim <br>";
    echo 
    "<b>ICQ:</b> $icq <br>";
    echo 
    "<a href="mailto:$email">Email <b> $username </b></blockquote>";

    ?>
    This is what it prints out:
    Welcome koomann.
    You registered on: Dec 31, 1969 06:00 PM
    Contact Info:

    AIM:
    ICQ:
    Email koomann


    I don't know what I'm going wrong...

    (NOTE: the reason why the $username still shows up, is because of "accesscontrol.php", the included file at the top).
    Last edited by koomann; May 14, 2003 at 17:51.

  2. #2
    if($awake){code();} PHP John's Avatar
    Join Date
    Jul 2002
    Location
    Along the Wasatch Fault line.
    Posts
    1,771
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm afraid I don't see the problem. Could you point out just what is not working?
    John

  3. #3
    $postcount++; koomann's Avatar
    Join Date
    Feb 2003
    Location
    Posts
    428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It dosen't pring out the information: $icq, $aim, $email ect. ect.

    www.star-craftx.com/practice/xdesigns/bob.php

    login is: koomann/blah
    The date is also out of wack... >=\

  4. #4
    if($awake){code();} PHP John's Avatar
    Join Date
    Jul 2002
    Location
    Along the Wasatch Fault line.
    Posts
    1,771
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would bet that for some reason these variables are not being assigned a value.

    You will have to dig into those includes to find out where they were supposed to be assigned.
    John

  5. #5
    $postcount++; koomann's Avatar
    Join Date
    Feb 2003
    Location
    Posts
    428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But the includes don't assign any variables, except for "accesscontrol.php", which carries over the $username

    db.php - dbConnect function...
    common.php - hold an error function for when a part of a form isn't filled out, it'll prompt up a small message box, then bring them back to the form.

  6. #6
    Visible Ninja bronze trophy
    JeffWalden's Avatar
    Join Date
    Sep 2002
    Location
    Los Angeles
    Posts
    1,709
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    I don't understand then, where are the $aim and $icq variables supposed to be coming from? There is no source for them.

    Maybe I'm just being ignorant.
    TAKE A WALK OUTSIDE YOUR MIND.

  7. #7
    if($awake){code();} PHP John's Avatar
    Join Date
    Jul 2002
    Location
    Along the Wasatch Fault line.
    Posts
    1,771
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Exactly. Just where are these variables being assigned?
    John

  8. #8
    $postcount++; koomann's Avatar
    Join Date
    Feb 2003
    Location
    Posts
    428
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Doesn't this do it?
    PHP Code:
    $sql "SELECT * FROM design_users WHERE
    date_joined='
    $date_joined' AND icq='$icq' AND aim='$aim' AND email='$email'"

  9. #9
    if($awake){code();} PHP John's Avatar
    Join Date
    Jul 2002
    Location
    Along the Wasatch Fault line.
    Posts
    1,771
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by koomann
    Doesn't this do it?
    PHP Code:
    $sql "SELECT * FROM design_users WHERE
    date_joined='
    $date_joined' AND icq='$icq' AND aim='$aim' AND email='$email'"
    No. $date_joined, $icq, and $aim all need to have a value assigned to them in order for that query to even work.

    What you want to do is to retrieve that information FROM the database.
    PHP Code:
    $result      mysql_query"SELECT * FROM design_users WHERE user_name = '$user_name'" );
    $resultArray mysql_fetch_array$result );
    $date_joined $resultArray['date_joined'];
    $icq         $resultArray['icq'];
    $aim         $resultArray['aim']; 
    Now you can use the $date_joined, $icq, and $aim variables because they now have a value to return.
    John


Bookmarks

Posting Permissions

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