[quote name='Nick D' date='Jan 19 2009, 09:00 PM' post='36933']
I need two tables on the same page with the following sql statments:
Table 1: Select name, pts, wins,losses from standings where div=1, order by pts, wins
Table 2: select name, pts, wins,losses from standings where div=2, order by pts, wins
Hitch, If I forgot about separating the two tables and just put them in one, I need to at least group them by divisions. Is this how groups work? Can you direct me to how I would set it up? If I click on 'Group by', it only gives me MIN, MAX, etc..I just want to simply group them by division(div).DIV is a name in my table that is an integer. div=1 or div=2
The search question was for another table. Here's the sql statement:
Select name, pick1, pick2, pick3 from Picks where week= Session(week)
The Session (week) variable is set using a pulldown box from the top of the table.
If I use a search, it gives me a search for any field. I just want a pull down of the week(in table named week_list) for the user to pick from. Doesn't seem like it's easy to do.
I know the sql statements I need to get my project going. Can't I just insert the sql statements somewhere using session variables?
You mention you have 2 tables, this is how you could get all the records in one table
select
t1.name, t1.pts, t1.wins, t1.losses, t2.name, t2.pts, t2.wins, t2.losses from standings t1, standings t1, standings2 t2
where
t1.div=1
and
t2.div=2
order by t1.pts, t1.wins[/color]
However I notice that you seem to have in fact only 1 table (you cannot have 2 tables with same name in one schema), so the grouping should be easy.
select
name, div, pts, wins, losses
from standings
group by div
order by pts, wins
(no need to specify where div =1 or div =2, the group function does that for you)
As for your second question:
If I use a search, it gives me a search for any field. I just want a pull down of the week(in table named week_list) for the user to pick from. Doesn't seem like it's easy to do.
Well I am new to PHPRunner and this is rather an easy one <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=36937&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />
Simply go to the visual editor, click on properties of the search field you would like to display the weeks, (on the search page). When you open the properties window, select table lookup and sepect your table then your week field and select drop down list (you will find this in the table lookup on properties window). After that just build your project and it shoudl allow you to select the weeks from a drop down menu, easy <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=36937&image=2&table=forumreplies' class='bbc_emoticon' alt=':)' />
Hope this helps (well at least helps Jane and Sergey not to have to answer everything themselves)
PHPR rocks!