SQL Query help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nishmgopal
Forum Contributor
Posts: 101
Joined: Tue Mar 03, 2009 9:38 am

SQL Query help

Post by nishmgopal »

Hi guys, this is my sql statement:

Code: Select all

 
SELECT
    Person_ID.Person_Name, Person_Skill.Skill_name, Person_Skill.Score, ID_Table.Weight, (Person_Skill.Score-ID_Table.Weight) AS total,sum(ID_Table.Weight) AS sumweight,SUM(Person_Skill.Score) AS sumscore, Job_ID.Job_Name, ID_Table.Skill_Name
FROM
    Job_ID
    JOIN ID_Table
       USING (Job_ID)
    JOIN Person_Skill
        USING (Skill_Name)
    JOIN Person_ID
        USING (Person_ID)
WHERE Person_Skill.Skill_Name='Nish'
 ORDER BY
    total
DESC
 
 
BUt it returns NULL in all the columns.... can someone please help me and suggest how I can change my query...?

Thanks
User avatar
JAB Creations
DevNet Resident
Posts: 2341
Joined: Thu Jan 13, 2005 6:44 pm
Location: Sarasota Florida
Contact:

Re: SQL Query help

Post by JAB Creations »

Hi Nish,

There is a database forum on DevNetwork, you really should be posting something like this with 91 posts.

That being said I would suggest trying your query in phpMyAdmin as it should give you some helpful information about any errors it may encounter. Also use PHP's mysql_error function to help you debug the issue. Good luck!
Post Reply