User Profile

Collapse

Profile Sidebar

Collapse
jaxpylon
jaxpylon
Last Activity: Jun 20 '07, 01:29 AM
Joined: Jun 8 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • It might be possible to do it using a column alias:

    Code:
    CREATE TABLE table2 SELECT *, usern AS username FROM table1;
    Else, you can do it in two transactions:

    Code:
    CREATE TABLE table2 SELECT * FROM table1;
    
    ALTER TABLE table2 RENAME COLUMN usern to username;
    See more | Go to post

    Leave a comment:


  • jaxpylon
    replied to Multiple Join MySQL Query
    Not entirely sure what you mean by a condition when it joins. It gets the other username (the topic creator) prefectly fine.

    Essentially, what I need for that second user name is:

    Code:
    SELECT Usr_Name
    FROM user_account
    WHERE Usr_ID = (SELECT Poster_ID
                    FROM message
                    WHERE Post_Date = (SELECT Max(Post_Date)
                                       FROM message)));
    ...
    See more | Go to post

    Leave a comment:


  • jaxpylon
    replied to Coding a Daily Attendance Register in PHP
    in PHP
    I assume you already have some users table in the database?

    What you need to do is create a new table in your database - let's say DailyRoster.

    Code:
    CREATE TABLE DailyRoster {
        id_user int(11) NOT NULL, -- Should be the same as the key in your users table
        date datetime NOT NULL,
        PRIMARY KEY (id_user, date)
    };
    Then, just put this on your page. This will check if a user's...
    See more | Go to post

    Leave a comment:


  • jaxpylon
    started a topic Multiple Join MySQL Query

    Multiple Join MySQL Query

    I'm having trouble with a query and am wondering if someone can help me. What I'm doing, is getting a list of topics for a "category" from a database for a forum. For each topic, I need its details (title, desc, etc), the name of the creator (from a users table), the number of replies, and information on the last post in each topic (including the name of the person who posted. The current category ID is identified by a URL parameter "$url_param "...
    See more | Go to post
    Last edited by jaxpylon; Jun 8 '07, 05:11 AM. Reason: Added more info.
No activity results to display
Show More
Working...