Jump to content

Anzeo

Members
  • Posts

    213
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Anzeo's Achievements

Member

Member (2/5)

0

Reputation

  1. Please completely remove my account from your database(s), thanks.
  2. This allows (with some changes to your example) to order parents and childs correctly. However, my initial question was wether it would be possible to obtain a resultset (from one query!) like this: array( 0 => array( 'Name' => 'parent_name', 'Children' => array( 0 => array('Name' => 'child1_name',...), 1 => array('Name' => 'child2_name',...), ... ), ... ), ...) Thus selecting an array of results as a column of another (parent) result?
  3. The structure of the table is as follows: ID int(11) Name varchar(45) Link varchar(45) IsActive tinyint(1) OrderNr int(11) ParentID int(11) So parent nodes have a ParentID equal to 0, while child nodes will have the ID of a parent node as their ParentID.
  4. okay, not sure if this is even possible, but thought I might as well ask you guys. I store my menu in my database, in one table MENUITEM. I have two levels, so there are parent and child items. Parent items have a ParentID of 0, while child's have an existing MENUITEM.ID as their ParentID. However, the problem lies in fetching all information in one query. By this I mean I'd like to fetch the parent items together with their child items in a single query. Currently I've devised this query: 'SELECT M1.Name AS ParentName,M2.Name AS ChildName FROM MENUITEM AS M1 LEFT JOIN MENUITEM AS M2 ON M1.ID = M2.ParentID WHERE M1.ParentID=0 ORDER BY M1.OrderNr' When outputting the result, I get: -PARENT_1 -PARENT_1_CHILD_1 -PARENT_1 -PARENT_1_CHILD_2 However, I would like to get: -PARENT_1 -PARENT_1_CHILD_1 -PARENT_1_CHILD_2 I cannot use a concat on a GROUP BY, as I need the separate records of the childs (with all their information). So I would like to have per parent record an array as column, containing all childs of that parent. Long explanation, short question: is this possible ? Thanks in advance!
  5. Maybe this could help you out? (haven't tested it myself) $result = mysql_query("SELECT venues.address, venues.venuenum, events.enddate, events.venuenum FROM venues, events WHERE events.venuenum = venues.venuenum AND events.enddate BETWEEN CURDATE() AND DATE_ADD(CURDATE(),INTERVAL 1 MONTH)") or die(ERROR:EVE());
  6. I found this site, which might do the trick for you, could you confirm? http://css-tricks.com/perfect-full-page-background-image/
  7. You can try to use a JOIN statement in your query. Can you provide the structure of the two tables you're fetching information from?
  8. You need to define width:100% on your body (assuming this contains your bg image?). Do not forget to also call width:100% on html as % only works if your parent has a width declared. If that doesn't work, try removing the * {padding:0;margin:0;} under tweaks.
  9. As Mchl points out, why are you creating a seperate table for each user? I suggest making one USER table (with the same create statement) and then inserting each user as a row into it.
  10. Awesome David! This works, thanks for the clear explanation. There's a '?' in my code as I'm using data binding in my queries. Thanks again!
  11. Does someone have a clue? Still not able to figure out what I'm doing wrong here. TIA
  12. Ok, this shoudn't be that hard at all, yet I cannot seem to find it myselve. As I'm sure someone here will see this in 5s, I'm asking for that person's help . I have a POST and COMMENTING table (never mind the COMMENTING table name, it's cause users can comment on posts and users). Now, what I want to do is list all my posts and show how many comments were made on each of these posts. For that I've constructed the following query: 'SELECT POST.ID,Subject,Body,Name,GivenName,Surname,UpdatedAt,AuthID, COUNT(COMMENTING.ID) AS NrOfComments FROM POST INNER JOIN USER ON POST.AuthID = USER.ID INNER JOIN FAMILY ON USER.FamilyID = FAMILY.ID INNER JOIN CATEGORY ON POST.CatID = CATEGORY.ID LEFT JOIN COMMENTING ON COMMENTING.CommentableID = POST.ID WHERE CommentableType=? GROUP BY POST.ID' The problem is, when there are posts with no commentings (a.k.a comments) they are not returned by this query. The COMMENTING table has an ID,CommentableType (either' post' or 'user' as string values) and a CommentableID (the ID of the user or post). Can anyone spot my error? Any help greatly appreciated! Thanks in advance, Anzeo
  13. Hi all, I have a quick question. I've recently started using CodeIgniter and I love it. However I've ancountered a problem and havn't found a solution on their forums for it. The problem is I'm using the Filter System (which works great). But a few days ago I tried out Modular Extensions(ME). I've managed to set it up and make it work, yet my filters do not function anymore. They don't even trigger at all! Is there anyone who has experience with this and knows how to make filters work together with ME? Cheers and thanks in advance, Anzeo
×
×
  • 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.