Results 1 to 3 of 3
  1. #1

    Need Help with Mysql Query

    Hi,
    I am working on an application that shows the users the hours worked in a week and a dispaly in a field the sum of hours.I am using a cookie to save the user name "$_SESSION['MM_Username']" but when I run the query it fails, here is my query:

    $query_rsSum = "SELECT Name, sum(Hours) FROM Work_table WHERE Name = '$_SESSION['MM_Username']' GROUP BY Name";


    Please help me correct it.

    Thank you.

  2. #2
    Try:

    $query_rsSum = "SELECT Name, sum(Hours) FROM Work_table WHERE Name = '{$_SESSION['MM_Username']}' GROUP BY Name";

  3. #3
    Thank you "HostingFreaks" for your help

Similar Threads

  1. MySQL Select Query - Selecing 2 tables with 1 query
    By SmashedPumpkins in forum Programming Discussion
    Replies: 2
    Last Post: 04-22-2010, 01:45 PM
  2. Mysql query LIKE%
    By net4all in forum Programming Discussion
    Replies: 3
    Last Post: 03-12-2010, 10:15 AM
  3. Need help with mySQL query
    By null in forum Programming Discussion
    Replies: 3
    Last Post: 12-22-2004, 02:34 PM
  4. MYSQL Query
    By WLHosting in forum Programming Discussion
    Replies: 1
    Last Post: 07-11-2003, 01:54 AM
  5. help with a MySQL query
    By MGCJerry in forum Programming Discussion
    Replies: 2
    Last Post: 12-13-2002, 04:33 AM

Posting Permissions

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