Jump to content

mabus

Members
  • Posts

    22
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mabus's Achievements

Member

Member (2/5)

0

Reputation

  1. I need to create a PHP method (with parameters) that can be called by a Flash application. This method is supposed to return an XML document. How do I go about doing something like this?
  2. Hello, I'm having another mysql query problem, and this involves something like pivoting a query table. Here's my example table.. YearMonth | TotalView | ViewType 2008-01 100 Type1 2008-02 200 Type2 2008-03 300 Type1 Now, what I want to achieve is that instead of having that "ViewType" column, I would want to have colums that are the values from that "ViewType" column. In other words, it will be two additional columns namely "Type1", and "Type2"... here's a sample result of what I would want... YearMonth | Type1| Type2 2008-01 100 10 2008-02 200 200 2008-03 300 300 Something like that. The way I see it, I need to do a pivot on the table rows, but I do not know how to do that yet, and I haven't found a good tutorial for it yet. So, if you have ideas on how I I may achieve this, please send your advices. Thanks in advance
  3. This one works dude. The "yearmonth" , and "totalviews" columns that it produces are correct , except for the lasts ones. What I'd like to have is to have different columns for the view types too. Got any query suggestions on how I can I achieve that? again, thanks in advance.
  4. thanks for that dude. I appreciate it..
  5. ahahahhahaha.. thats fun.. hhhmm ..I'm not too good at joins. can anyone give me a sample query on this? thanks in advance guys, I really appreciate it
  6. hhhmm..joins are too expensive, os I'm putting that as a last resort
  7. Hello, I have mysql query problems that I can't seem to figure out yet. the scenario involves two tables, and the objective is to be able come up with an uput that combines the reults from the two related tables. here's the scenario. ViewType (Id, Name) < --- this is a lookup table Table B (Id, ProfileId, Date, ViewTypeId) <-- ViewTypeId field is a foreign key associated with ViewTypeTable Now, what I am aimign for is to come up with results that summarizes according the month and the view type. So the table should have these columsn "Date", "Number of Views", "ViewType 1 view" , "View Type 2 view" Please share your ideas to me. Thanks in advance...
  8. My situation involves querying two tables. One table contains records that match the other in a one to many relationship. Example Person - Id - Name FavoriteColor -Id - Name - PersonId. The example above shows what my situation is like. This basically means that each peroson can have 0 or more FavoriteColors. Now, in this case that I want to come up with a table that contains the list of person, regardless if they have or not have any favorite colors. Sample Output (desired ouput) PersonName ColorName John Blue John Red Doe James Green Bill How will I be able to come up with a result like that? What I want is to be able to display results, even if a particular person profile has a matching color or not. Thanks in advance
  9. I have 2 tables, say, "Person" and "Hobbies". Person can have zero or more hobbies. Here's what the table structure looks like: Person (Id , Name) Hobbies (Id, PersonId, HobbyName) How do I get all the Person->Id where Person->Name is, say, 'John' regardless if the record has a hobby?
  10. I want to be able to implement full text searching. Apparently, I am only able to do it on one table. What I am looking for is how I may be able to do it on more than one tables. The tables that I will be using already has some colums / fields indexed to be full text, and all I need is a sample query on how I may go about doing so.
  11. How do you perform a full text search on more than one table, in one query? This, of course has tables with columns indexed as full text.
  12. Hi, I need help on how I may go about doing some get variable passing from one page to another. The situation is that , it all starts in one form, with a method of 'GET'. It has to be 'GET' 'cause the query string that it generates for the url is important for this case. Now, when the form is submitted, there will be a result page that has a link to another page. What I want is that when this url link is clicked, the results of the passed form (basically the $_GET variables) is also passed to that other page. My problem is how am I going to pass the $_GET variables via that url link. Is there a method that can convert the $_GET variables automatically into a string? or is there a method to get the generated url query string so I can pass it around? Please send in your comments. Thanks
  13. I want each user to have one row, and the dates that is to be displayed is the most recent one.
  14. THanks for the reply guys. However, doing a MAX on the dates did not quite work for me. The other approach of sorting by date in descending order, and limiting the result to 1, resulted to creating a 'SELECT' statement within an outer 'SELECT' statement. For example... SELECT tableOne.SomeId, (select tableOne.SomeId, tableone.Date from TableOne order by date DESC limit 1 ) FORM tableOne as tableOne WHERE ...<snip> It was something like this. I got the result that I want, but am dissapointed 'cause the execution time reached about 12-13 seconds. This is not good, in this case. Any suggestions on how I may optimize the query?
  15. I need some SQL help. Here's my table: Activity - Id (PK) - ProfileId (FK) - Date Each record represents a profile's activity in the CMS we're building (e.g. user updated profile, user uploaded photo, etc.) I'm only interested Id, ProfileId, and Date of the latest activity. How do I get that?
×
×
  • 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.