SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: help

  1. #1
    SitePoint Zealot DBallerz01's Avatar
    Join Date
    Jan 2004
    Location
    CT
    Posts
    172
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    help

    PHP:--------------------------------------------------------------------------------
    <?php
    include("header.php");
    global $db, $module_name, $prefix, $cookie, $user;

    cookiedecode($user);
    $username = $cookie[1];

    OpenTable();
    $result = $db->sql_query("SELECT * FROM nuke_users WHERE username = '$username' and where user_crew = '$user_crew'");
    $row = $db->sql_fetchrow($result);
    $user_crew = $row[user_crew];

    echo ("$user_crew");
    CloseTable();

    ?>

    --------------------------------------------------------------------------------


    what is wrong, I get a blank page when I run this

  2. #2
    My precious!!! astericks's Avatar
    Join Date
    Mar 2002
    Location
    Vancouver, BC
    Posts
    1,971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    $result = $db->sql_query("SELECT * FROM nuke_users WHERE username = '$username' and where user_crew = '$user_crew'");


    Where is the $user_crew variable coming from? Is it set?

    I suggest you echo out the $user_crew variable to see whether it is set or not.

    Lemme know how goes.

  3. #3
    SitePoint Zealot DBallerz01's Avatar
    Join Date
    Jan 2004
    Location
    CT
    Posts
    172
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i did it like this
    <?php
    include("header.php");
    global $db, $module_name, $prefix, $cookie, $user;

    cookiedecode($user);
    $username = $cookie[1];
    $user_crew = ("SELECT user_crew FROM nuke_users WHERE username = '$username'");
    OpenTable();
    $result = $db->sql_query("SELECT * FROM nuke_users WHERE username = '$username' and where user_crew = '$user_crew'");
    $row = $db->sql_fetchrow($result);
    $user_crew = $row['user_crew'];

    echo ("$user_crew");
    CloseTable();

    ?>

    still no result

  4. #4
    My precious!!! astericks's Avatar
    Join Date
    Mar 2002
    Location
    Vancouver, BC
    Posts
    1,971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try this:
    PHP Code:
    include("header.php");
    global 
    $db$module_name$prefix$cookie$user;

    cookiedecode($user);
    $username $cookie[1];
    $usercrew $db->sql_query("SELECT user_crew FROM nuke_users WHERE username = '$username'");
    $row $db->sql_fetchrow($usercrew);
    $user_crew $row['user_crew'];
    OpenTable();
    $result $db->sql_query("SELECT * FROM nuke_users WHERE username = '$username' and where user_crew = '$user_crew'");
    $row $db->sql_fetchrow($result);


    echo (
    "$user_crew");
    CloseTable(); 
    edit: it seems a bit odd to have 2 queries thast are pretty much doing the same thing. what are you trying to do? lemme know, maybe we can combine the 2 queries in one.

  5. #5
    SitePoint Zealot DBallerz01's Avatar
    Join Date
    Jan 2004
    Location
    CT
    Posts
    172
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it worked, thank you so much i tried to solve this for a while,

  6. #6
    My precious!!! astericks's Avatar
    Join Date
    Mar 2002
    Location
    Vancouver, BC
    Posts
    1,971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you're welcome

    the prob was you werent returning the resultset fromt he first query before running the second query


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
  •