Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Member unclekyky's Avatar
    Join Date
    Sep 2003
    Posts
    62
    Member #
    2938
    I have a script that checks if the user is logged in(that part works). I can request the username with $_SESSION['username'].

    I also have a table in my DB with the location of the user.

    So when i collect some info from a textbox(that works), the username of the person who submited it(that works too), and the location(this doesn't work).
    When i request the location it say: Resource id #10 or Resource id #12. What is the problem?

    PHP Code:
    <?php 
    require 'db_connect.php';
    if(
    $logged_in == 1) {
        echo(
    'You are logged in as '.$_SESSION['username'].'.');
    }

    $db mysql_connect("localhost","webjunk","**********"); 
    mysql_select_db ("webjunk_test"); 
    $q mysql_query("SELECT location FROM users WHERE username = '".$_SESSION['username']."'");

    $query "INSERT INTO post (name, comments, location) 
    VALUES('"
    .$_SESSION['username']."','".$_POST['com']."','$q')"
    $result mysql_query($query); 
    include 
    "post_view.php"
    ?>
    <br><br><br>
    <?
    include "post.php";
    ?>

  2.  

  3. #2
    Senior Member Brak's Avatar
    Join Date
    Apr 2003
    Location
    San Francisco, CA
    Posts
    3,413
    Member #
    1217
    Liked
    2 times
    Most likely you are trying to output the value of a mysql_query, that's what the Resoruce ID # are AFAIK. From your code, it's hard to tell exactly what's going on since post_view and post are missing and probably contain the offending code.
    Kyle Neath: Rockstar extraordinare
    The blog | The poetry site | The Spore site


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 11:16 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com