Jump to content

Brian W

Members
  • Posts

    867
  • Joined

  • Last visited

Posts posted by Brian W

  1. Well, essentially I think my problem is that I have it set up that messages can be a child of either 'teams' or 'events', so I have to run a sub query to get the data per message. If all the messaged I was trying to pull up had the same parent (such as when I am pulling the messages in the context of the actual board) it would not be a problem because I would use a simple JOIN to do so. A conditional query would be awesome, something like "if an event is found with the board column value X ? CONCAT(league.leagueAcro,'>',event.title) as title : CONCAT(league.leagueAcro,'>',team.name) as title".

    Is that possible with MySQL?

    The only two solutions meanwhile I can think of are dirty fixes (IMO).

    #1, to have the league ID referenced in the messages table so that I didn't need to pull that from another table... but I need to reference it in the 'teams' and 'events' table already so I don't want duplicate information all over the place since I already need to JOIN the 'teams' OR 'events' table to the message.

    #2, get the messages in one query and then loop queries for each message to get the additional info.

  2. I mean, the league field in the `event` and `team` table are used to reference the `leagues`.`id` field...

     

    @ngreenwood6, I cleaned the code up a little (ie used " rather than ' around the $query string so it wouldn't use the variables literally and also added a comma between the two columns in the SELECT statement...) and the query returned nothing.

     

  3. I'm not sure what you mean by tell you what I'm trying to get... I thought I explained it in the my first message.  :shrug:

    Table 'messages':

    || id || message || uid || time || board ||

     

    Table 'events':

    || id || title || description || league ||

     

    Table 'teams':

    || id || team || league || state || board ||

     

    Table 'leagues':

    || id || league || leagueAcro ||

     

    Table 'members':

    || id || username || password || email || posts || admin || moderator ||

  4. I have 5 tables that I need to interconnect: messages, events, teams, leagues, and members. A message can either be for an "event" or a "team". The query is supposed to get the last 5 messages posted for a specific league.

    Through some sub-queries and a JOIN I've got all of the information I need but I cannot use one of my fields (league) within my WHERE clause presumably because the field is populated by one of my sub-queries. I need either a solution or some advice on a different structure for my query. Here is the query:

    SELECT m.*,u.username,
    (SELECT CONCAT(l.leagueAcro,'>',e.title) as title FROM events e LEFT JOIN leagues l on l.id = e.league WHERE e.board = m.board
    UNION
    SELECT CONCAT(l.leagueAcro,'>',t.team) as title FROM teams t LEFT JOIN leagues l on l.id = t.league WHERE t.board = m.board) as title,
    (SELECT e.league FROM events e LEFT JOIN leagues l on l.id = e.league WHERE e.board = m.board
    UNION
    SELECT t.league FROM teams t LEFT JOIN leagues l on l.id = t.league WHERE t.board = m.board) as league
    FROM messages m LEFT JOIN members u ON u.id = m.uid
    WHERE league = 2 LIMIT 5

    the field `title` ends up looking something like "Football>team's name" or "Soccer>teams vs other team".

    The last line is what is screwing me up, the column `league` is populated through the second sub-query which leads me to believe mySQL processes the WHERE clause before it runs a sub-query for every singe db entry which makes since for performance reasons.

    Unknown column 'league' in 'where clause'

     

    Thanks in advance for any help...

  5. Okay, so there is more than one way to skin this cat but today I came across this website which has thrown me off entirely.

    http://multiply.com/user/join/

    The outside container for the form is easy explanation... they use images for the rounded corners.

    The inner box around the CAPTCHA is what confuses me. In Firefox, I used Firebug to look at the CSS and its just using "-moz-border-radius-..." which isn't cross browser. Beings that I was looking at the page because I liked their form, I wanted to know what it looked like in IE... the CAPTCHA box has rounded corners still!!!!  :wtf: How did they do it? I can't find anything in the CSS or HTML that suggests the technique they used. Maybe I'm blind. :shrug:

  6. I got the frame's id and tried to call it like this:

    top.frames['theId'].location = 'thepage'

    FF doesn't respond to it, IE acts like I simply said window.location.

    I also tried:

    top.frames['theId'].src = 'thepage'

    and

    theId.location = 'thepage'

     

    I tried several more things, then I tried using the frame's name with top like:

    top.iframe_canvas.location

    which to me I think so far is the most promising but IE still treats it the same as window.location as well as FF (which is okay, FF functions as it should not surprisingly)

     

    Thanks so far for everyone's input. Anymore ideas?

  7. Hmm, thought I had provided enough information.

    Facebook allows you to pick between their markup language or use an I frame when developing an Application for Facebook users.

    I chose to do an iFrame so I could use JS and not worry about learning there language. I've encountered a problem now with navigation in IE(8 + 8 compatibility mode) because I'm using document.location='pageToGoTo' to move the end user to a new page. Problem, in FF(3) the the iFrame's src changes which is how I intended it to work... in IE it takes the user away from Facebook to my website.

    I could change the iFrame src if that is a possible solution, but how do I do that from within the iFrame?

     

    Not important to my problem perse, but doesn't allowing the app to move a user away from Facebook un-knowingly a security hole for the user. Imagine an app that would at some random point move the user to a Facebook clone page that came up with the classic,well known message saying you needed to log in again. Viola, phished. I'm not sure how many users actually ever look at their url when they are prompted for private data... but I know it is a small percentage.

  8. I'm writing an Facebook app and ran into an interesting problem. I'm using the iFrame option. I'm using a button with a onClick event to change the document.location with in FF works fine, but in IE it takes them away from facebook directly to the page on my server. I didn't expect Facebook would allow for something like this, but I can direct them away from Facebook entirely! First this shakes my trust in any Facebook application in the future as well as IE (just begging for phishing problems!).

    Any ways, I want to know how to get just the iFrame's location to change as in how FF does it.

  9. Hey Corbin,

    I'm not sure yet whats up with it getting locked up yet, but the UI improvements make up for the occasional headache which has decreased in occurrence... probably because I'm not installing programs and configuring things anymore.

  10. Today I set up a machine with Windows 7 Ultimate. After finding that many of the major configuration managers (such as "Turn Windows features on or off") were a little harder to find, I got IIS7 up and rolling. A quick Google search for "php iis7" lead me to the very first result which was the IIS website. A nifty tool that some may have been familiar with already was featured on the page called "Microsoft Web Platform Installer". I downloaded, curious if it would actually save me time, and was pleased to find that it worked as it said it would. MySql is not listed under the DB section, but overall Windows 7 itself had held our so far for the instillation of PHP and even ran a "Hello World" test without restarting the service manually.

    As for non PHP related Windows 7 review, I'm not sure if I like some of the Mac OS like features the GUI has picked up. The task bar is interesting but feels more like Mac OS that the classic Windows structure. Con if you ask me, I'd have a Mac if I wanted one...

    Due to the fact my apartment is old, I don't have a wired network set up besides in the living room so I had the system plugged in for installation but planned on moving to WiFi. I discovered that my Linksys Wireless G adapter didn't have Windows 7 x64 support, my Airlink adapter did though. At some point during setting up IIS+PHP+MySql my wifi driver got corrupted or something and I had to reinstall it.

    I've had Windows Explore stop responding more often then I ever had XP or Vista, but I didn't use either of those heavily within the first month of there release. If they can get some of those problems resolved I will be happier with the product.

     

    3/5 for OS currently, 5/5 if they can get the bugs fixed soon and get compatibility with more devices.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.