d_barszczak
-
Posts
188 -
Joined
-
Last visited
Posts posted by d_barszczak
-
-
I used this in the end.
SELECT `order`, `tag` FROM `nav_directory` ORDER BY `order` desc LIMIT 1;
This alway returns the highest value with the tag.
EDIT: Also gone and named `order` which is a reserved word. Need to be more careful with my naming stratergy.
-
Thanks but that gives me the same result.
I want the highest value of `order` and the `tag` that accompanies it.
Thanks.
-
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???
-
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.
-
I was chopping a potato last night when i cut myself. I figured if i'd had not potato i would not have been chopping it therefore would not have cut myself.
Then of all things it tried to put the blame on the knife.
-
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.
-
Just wondered because i did for the first time today.
-
Gotcha, need to start using the old noodle.
Thanks for all you help
-
you mean like _date for instance?
-
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.
-
OK so talk about making a rod for your own back. I get the script that you sent me and have changed it to suit my needs and would work great if i had not done one stupid, silly, mistake.
I named the months ie November not 11 like i should have.
-
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. ???
-
I thought it was ok as long as you used `column`!
But anyways it won't be a problem once i update the database as they will be eventually removed.
Thanks for all you help on this fenway.
Can i ask you a question? Are you self taught or did you study to learn mysql php?
-
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.
-
OK thanks again.
How can i get the values from my columns to use in the STR_TO_DATE
Im sorry if i seem a little thick.
-
OK this is the big one.
Before i write a php script to do this for me is there any way to transform my day, month, year, minute and hour columns into the new date column?
-
lol, i posted the wrong query
Thats how the database works currently and trying to figure out how to convert it to the better method.
Thanks for all your help on this by the way.
Ill be back when i have converted my data.
-
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
-
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.
-
OK Thanks for your help.
What does the where 1 do?
-
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.
-
Anybody willing to help me out?
-
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.
-
It's a hitcounter so theres not really a link. It involves putting a script on your webpage. Similar to Adsence. PM me if your still interested.
Have you ever swore at a potato?
in Miscellaneous
Posted
Ok thats close enough, Place a vote.