AOA AOA AOA Folding For Team 45 AOA Files Home Front Page Become an AOA Subscriber! UserCP Calendar Memberlist FAQ Search Forum Home


Go Back   AOA > Software > Programming and Assembly Language

Programming and Assembly Language Please read this Topic's rules!!

Reply
 
LinkBack Thread Tools Rate Thread
  #1 (permalink)  
Old 30th April, 2003, 05:42 PM
SiGmA_X's Avatar
Member
 
Join Date: April 2002
Location: Portland, OR
Posts: 1,529
Send a message via ICQ to SiGmA_X Send a message via AIM to SiGmA_X Send a message via MSN to SiGmA_X Send a message via Yahoo to SiGmA_X

PHP Query Help :)

Okay, here's what I'm doing.. I am selecting a bunch of stuff from a database, from 3 tables. I need to select most of the fields from the news table, and the displayname and id from the authors table. I need to select the number of posts from the post table (I used COUNT(*) WHERE postid=id before, but doesn't work with this because of the JOIN). Also, I need to get the displayname (from the authors table) of the corrisponding edit_authorid (from news table). I want to do this in as few queries as possible. I can get everything other then the posts count, and the edit info, because the edit info is dependant on the info being edited. I think I might have a workaround for that, by adding one extra query. But I can't think of a way to get the post's info figured out with out running a new query for each post, which will add 20 queries to the page load..

Here's what I have so far.. SELECT news.id, news.hits, news.forumID, news.timestamp, news.edit_timestamp, news.authorid, news.edit_authorid, news.subject, news.body, auth.id AS authorid, auth.displayname FROM pchm_news AS news, pchm_authors AS auth WHERE news.active='1' ORDER BY news.id DESC LIMIT 0, 20

I have been thinking about using a array to store all exatra data in, which would only add 2 more queries, which won't slow down the Quad 2GHz XEON server down much/any

I'll post anything else I get, but I really need some help ASAP
__________________
"In war, it is not the goal to die for your country, but rather to make the other bastard die for his!"
AOA Team fah
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
8k3a+ ram query Sideburns EPoX MotherBoards 3 16th December, 2005 12:08 PM
Query about a MR814 Rondog Mobile Devices and Networking 29 6th May, 2005 05:41 AM
12V PSU Query Not Slim EPoX MotherBoards 10 18th April, 2003 01:54 PM
Voltage Query - PSU ok? JEB EPoX MotherBoards 4 17th January, 2003 12:15 AM
Query About VIVO Lardmaster Graphics and Sound cards; Speakers and other Peripherals 8 22nd October, 2002 03:59 AM


All times are GMT -5. The time now is 09:13 AM.


Copyright ©2001 - 2009, AOA Forums

Search Engine Friendly URLs by vBSEO 3.3.0