Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old September 14th, 2003, 11:09 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
double select ?

Hello,
building a online news system and want to show in a web page categories and articles that are related to those categories.
Table 1 Categories
Cat_name
cat_id

Table 2 Articles
Article Name
cat id

When the web page is displayed
Category Name (cat_id =1)
Article 1 cat_id 1
Article 2 cat_id 1
Article 3 cat_id 1
Category Name (cat_id = 2)
Article 1 cat_id 2
Article 2 cat_id 2
Article 3 cat_id 3

I can do each one separtly, but not a the same time,

any ideas



Reply With Quote
  #2  
Old September 14th, 2003, 11:48 AM
tkarkkainen's Avatar
tkarkkainen tkarkkainen is offline
Moderator
Click here for more information
 
Join Date: Apr 2007
Location: Finland
Posts: 2,320 tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)  Folding Points: 11979 Folding Title: Novice Folder
Time spent in forums: 6 Days 8 h 50 m 37 sec
Reputation Power: 4
RE: double select ?

SELECT blahblahblah WHERE cat_id=1 OR cat_id=2

Reply With Quote
  #3  
Old September 14th, 2003, 12:48 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: double select ?

I don't have trouble writing select statements, what I have trouble with putting it all together..
I have two select statements
the first
select * from categories
while
echo "<tr><td> .$row["Cat_name"]. </tr></td>";
$finland = $row["Cat_id"];
select * from articles where cat_id = $finland;
while
echo "<tr><td>.$row2["Article_name"].</tr></td>

can anyone help me put this all together. Iam Oracle Web Dev, not much in PHP and wife needs help.



Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > double select ?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway