So far so good. I've totally butchered the message form to make an online flight contest that'll last the year. People register and add flights via forms, and stuff gets displayed by pulling crap from shiny new tables.
First thing that's got me upset is that when someone enters a flight the "flights" table stores the pilotID number along with all the groovy data about the flight. Eventually I have a page that lists the furthest flight from each site. On that page I want to say "XXX miles on NNN date by ZZZZZZ" where ZZZZZZ is the pilot's name. So is there a groovy way to JOIN the pilots table to the flights table? Here is, effectively, the query I'm doing to get the record-setting flight:
$query = ("SELECT pilots_number, site, start_date, end_place, MAX(miles), story FROM `flights` WHERE wing_type = 'hg' AND flight_type = 'opendistance' GROUP BY `site` ORDER BY `site` ASC");
Oddly enough, it actually works ;) So I figure I could just do another query to get the pilot's name from the pilots table using the pilots_number value, but it seems to me this would be a good place for a "join", or can I not JOIN if I'm GROUPING?
Next up, and this one is purely cosmetic, is converting "story" back to something that looks like a blog post. I would *love* to be able to push it through the smilies plugin and the auto-P plugin, but have no idea how to do that given that they fire on an actual item. Any hints on how I can do that? Like when the person types in a "return return" I should be able to make it display like that. Instead all I get is one huge paragraph of exactly what was entered.
I guess I should also be afraid of malicious crap hidden in html in the "story" but it's all old people who don't know html from a hole in the ground so I'm not too worried. BUT if it's easy to scrub an input the way comments on a post would be scrubbed that'd be way cool.
Thanks much for any help anyone can offer!