Jump to content

d_barszczak

Members
  • Posts

    188
  • Joined

  • Last visited

Posts posted by d_barszczak

  1. Hi all,

     

    Just when im getting to grips with this mysql business i have another problem ???

     

    The following query works:

    SELECT MAX(`order`) as `MAXorder` FROM `nav_directory`;

     

    which return MAXorder = 10.

     

    i would like it to return the tag also

    tag, MAXorder

    page1, 10

     

    My Solution to this was:

    SELECT `tag`, MAX(`order`) as `MAXorder` FROM `nav_directory` GROUP BY order;

     

    But that lists all the tags. Can anyone help???

  2. Hi all,

     

    I have a table that has 4 columns.

     

    tag, title, teamID, order

    test, Test Page, 3, 1

     

    The teamID is a number that relates to a teams table which consists of.

     

    id, team

    3, Team 3

     

    What i would like to do is run a query that shows me the team name not the team id in the first table. Is this possible.

  3. I am starting to look at SMF now, I have played with phpbb and i work with moodle.

     

    I just wondered if any one had tried to do anything like this before.

     

    I really need to pick one and stick to it but i don't want to get stuck down the line and some one say you should have used so and so it does it all for you.

  4. UPDATE yourTable SET theMonthField='11' WHERE theMonthField='November';[/Code]

     

    Right, right, right.. Here i go again.

     

    The hitcounter scripts has only been running since October so i used Hooker's advice as only 2 months needed to be updated. That worked great.

     

    Then i used Fenways advice to update the date column which now i has to change because seen as Fenway seems to be some sort of mysql god and i'd be stupid to ignore his advice date is still a reserved keyword and needs to be change (which i can do). Other that that its all good.

     

    Thanks for all your advice. I have learned loads about the date and time functions im mysql which in a way was my goal. I should now be able to design some reports for my system using my new methods.

     

    Thanks again to everyone who helped.

  5. Hi all,

     

    I am starting to play with forum scripts and im looking for advice on which one to use. I need one that is easy to setup but more improtantly easy for my users to navigate.

     

    Im going to want to try get it to authenticate using my current system so im going to have to customise it slightly so a good support group would help me greatly. I will also be updating themes so needs to be well coded.

     

    PHPbb is what i have used in the past but never tried to modifiy it.

     

    Any one any ideas.  ???

  6. currently i have a table thats like the following:

     

     

    date  day  month   year   hour   minute   second

     

     

    The date is currently something like 0000-00-00 00:00:00 for all records currently waiting to be populated.

     

    The others are formatted like the following: 15 December 13 00 00

     

    I want to populate the date column with the other information and then remove the old.

     

    There are about 21,000 records.

     

    I can do this with php but my mission to improove my mysql made me curious.

     

    ps. the hitcounter script that populates the table has already been updated to use the new date method. Luckly i had not designed the reports system yet so not too much trouble.

  7. I have been playing about all weekend with date and time functions an not only am i regretting all the time i have wasted programming the long way around but im also learning some awsome queries.

     

    So now im getting adventurous.

    SELECT DISTINCT month, count(month) as hits FROM hcl_counter WHERE `uid` = '5' GROUP BY month;
    

     

    The above will generate me a list of hits per month for uid 5

     

    MONTH HITS

    October 89

    November 320

     

    In the same query can i generate an avarage Hits Per Month from the hits column. Can this sort of thing be done.

     

    Once again thanks for all the help :)

     

  8. Thanks!!

     

    Another thing you might be able to help me with.

     

    In the past i have used a seperate column for day month year so the when i design a report i could filter by month and year. Can i do anything like this with the date and time functions and would be any quicker to process?

     

    This is really quite a weak area for me as my skills are more on the php side but working on a project which means that i need to strengthen my mysql side.

     

    Thanks for all your help.

  9. Hi all,

     

    Im am trying to further my mysql skills because i have been doing things the long way until now.

     

    Ok, I have a table which stores my users. When my users register it records the date and time the account was created. Users can't login until they have confirmed their email address. The datecreated column is a DATETIME and i have another script executed from cron that i would like to delete all unconfirmed account that are older than 5 days old. The column that detimins whether that email is confirmed is called confirmed 1 for true 0 for false.

     

    Im not sure how to do this even after reading the section on mysql's website.

     

    Hope you can help.

  10. OK maybe im not being clear.

     

    The script is a hitcounter which records traffic on a webpage. To test it you will need an ID to identify you as a user on the system. So i can't post you a link until you pm me. I can then create you an account which will then generate me a link that you can put on a website somewhere.

     

    Hope this is more clear.

×
×
  • 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.