View Single Post
  #1 (permalink)  
Old 10-30-09, 09:13 PM
sac0o01 sac0o01 is offline
Newbie Coder
 
Join Date: Jul 2009
Posts: 16
Thanks: 1
Thanked 0 Times in 0 Posts
Need help with SQL query

I have been working on a script that creates a directory named after the logged in username and then the user will be able to upload to that directory.

I am using the following to try and get the username so that I might insert it into the upload script path.


PHP Code:

<?php

session_start
();
include_once(
"dbc.php");
   if(isset(
$_SESSION['userSession']) && !empty($_SESSION['userSession']))
 
        include_once(
"dbc.php");
$username mysql_query("SELECT * FROM users WHERE username =".$_SESSION['userId']); 
?>
When I run it I get the following:
Error: The directory (/home2/freefor3/public_html/ rotas/sigs/Resource id #4) doesn't exist

Now I understand why it is printing out "Resource id #4" My question is what can I do to get it to return the username itself?
Reply With Quote