Search found 101 matches

by nishmgopal
Mon Apr 06, 2009 11:48 am
Forum: PHP - Code
Topic: PHP/SQL Query help
Replies: 2
Views: 496

PHP/SQL Query help

Hi.. I am having difficulty in joining my tables together to get the relevant information. Basically I have 5 tables: Skill_Tbl: -------- Skill_ID(Int 11) Skill_Name Person_tbl: ----------- Person_ID(Int 11) Person_Name Learnin_Style: ------------ Learning_ID (INT 11) Learning_Name (VARCHAR) Person_...
by nishmgopal
Fri Apr 03, 2009 6:32 am
Forum: PHP - Code
Topic: help with insert...
Replies: 3
Views: 280

Re: help with insert...

thank you very much that worked... now my problem is how to add multiple skills and multiple weights into the tables. My current structure only lets me add one value per table, so 1 skill id, 1 weight, and 1 job id....what if I wanted to add 3 skills with 3 weights for any particular job id. for exa...
by nishmgopal
Fri Apr 03, 2009 6:04 am
Forum: PHP - Code
Topic: help with insert...
Replies: 3
Views: 280

help with insert...

Hi guys, I am trying to insert values from the form into two different tables. The skill Name goes to the skill table, in which the Skill_ID is auto increment. and then I want to insert the weight and the last Skill_ID into the ID_Table. My code so far is below, i no i have to use mysql_last_insert_...
by nishmgopal
Tue Mar 24, 2009 3:31 pm
Forum: PHP - Code
Topic: Display Problems
Replies: 1
Views: 257

Display Problems

Hi, I am trying to display $PersonTotal and $JoBTotal as another row but am having difficulty formatting it correctly.... code:     $sql= "SELECT Person_Name, b.Skill_Name, c.id, ( d.Score - c.Weight ) AS total, d.Score, c.Weight, e.Job_Name FROM Person_ID a JOIN Skill_ID b JOIN ID_Table c ON b...
by nishmgopal
Tue Mar 24, 2009 7:24 am
Forum: PHP - Code
Topic: Help with Table Structure
Replies: 1
Views: 92

Help with Table Structure

Hi Guys I have been having some serious trouble getting the information I want, and Have taken the advise to restructure my tables. I have attached the Old Structure and the new one. I was just after some constructive advise on whether the new one is better and if it will help me get the info i want...
by nishmgopal
Tue Mar 24, 2009 6:55 am
Forum: PHP - Code
Topic: Problem with WHILE LOOP
Replies: 1
Views: 157

Problem with WHILE LOOP

Hi This is my code:   $sql= "SELECT Person_Skill . * , ID_Table . * , Job_ID.Job_Name FROM Person_Skill, ID_Table JOIN Job_ID USING ( Job_ID ) WHERE Job_Name='Manager'";   $result1 = mysql_query($sql) or die ("Couldn't execute query.");     while ($row=mysql_fetch_array($result1)...
by nishmgopal
Tue Mar 24, 2009 6:18 am
Forum: PHP - Code
Topic: Problems with my table
Replies: 6
Views: 149

Re: Problems with my table

yes most likely I can try and do that, will this help me in getting the result I want?
by nishmgopal
Tue Mar 24, 2009 5:50 am
Forum: PHP - Code
Topic: Problems with my table
Replies: 6
Views: 149

Re: Problems with my table

also i want to display each person as a different table, so for example if my database has two people, bob and dave, then there will be one table with the Manager Skill Name, the weight and Daves Score, then another table with Manager Skill Name, Weight and Toms Score....
by nishmgopal
Tue Mar 24, 2009 5:45 am
Forum: PHP - Code
Topic: Problems with my table
Replies: 6
Views: 149

Re: Problems with my table

Tried that but no luck... Still not getting the desired result. I think I might need some other loop function or something, I have changed my code to look like this:     $sql= "SELECT * FROM Person_Skill JOIN Person_ID USING (Person_ID) ORDER BY Person_Name";   $result1 = mysql_query($sql)...
by nishmgopal
Mon Mar 23, 2009 6:43 pm
Forum: PHP - Code
Topic: Problems with my table
Replies: 6
Views: 149

Problems with my table

Hi guy I am having trouble outputting my data into a html table, my code is:     $sql= "SELECT * FROM Person_Skill JOIN Person_ID USING (Person_ID) ORDER BY Person_Name";   $result1 = mysql_query($sql)   or die ("Couldn't execute query.");     while ($row=mysql_fetch_array($resul...
by nishmgopal
Mon Mar 23, 2009 3:20 pm
Forum: PHP - Code
Topic: SQL Query help
Replies: 1
Views: 131

SQL Query help

Hi guys, this is my sql statement:   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_...
by nishmgopal
Sun Mar 22, 2009 2:39 pm
Forum: PHP - Code
Topic: Is it possible to combine two sql queries?
Replies: 4
Views: 292

Re: Is it possible to combine two sql queries?

so even this wouldnt work?:

Code: Select all

$sql3= $sql . $sql2;
I tried it and got the error: Couldn't execute query.

Could you adivce me on how I can combine the two within the query?
by nishmgopal
Sun Mar 22, 2009 2:32 pm
Forum: PHP - Code
Topic: Is it possible to combine two sql queries?
Replies: 4
Views: 292

Is it possible to combine two sql queries?

Hi, This is my code:   $sql= "SELECT Job_ID.Job_name, ID_Table.Skill_Name, ID_Table.Weight FROM Job_ID JOIN ID_Table USING (Job_ID) WHERE Job_ID.Job_Name = 'Manager' ";   $sql2="SELECT Person_ID.Person_Name, Person_Skill.Skill_Name, Person_Skill.Score FROM Person_ID JOIN Person_Skill ...
by nishmgopal
Sun Mar 22, 2009 1:30 pm
Forum: PHP - Code
Topic: displayin results of sql query
Replies: 1
Views: 152

displayin results of sql query

Hi Guys, Below is part of my code, and I wanted to know how I can display the results as a html table with Job_Name, Skill_Name, Person Name, Skill_Name and Total as the columns   $sql= "SELECT     Person_ID.Person_Name, Person_Skill.Skill_name, (Person_Skill.Score-ID_Table.Weight) AS total, Jo...
by nishmgopal
Sat Mar 21, 2009 12:06 pm
Forum: PHP - Code
Topic: SQL Query help
Replies: 1
Views: 122

SQL Query help

Hey guys, I just wanted some advise on what my sql query would like for the following: I have two tables: Job_Table and Person_Table Job_Table has: j_name, skill, skill_weight Person_table has: p_name, skill, skill_score I want to write a query where The skills in jobs are compared with the skills i...