abdfahim Posted January 8, 2008 Share Posted January 8, 2008 I have a mysql table. I fetch the table using PHP and print those in webpage. The first column is Date, but I want to get the week number in my queries in place of Date. So which process do you think faster - convert the date to week using PHP when printing the query result or making another table with to columns (Week and corresponding Date) and inner join it with previous. I think the first process is faster, but just want to check it with experts. Quote Link to comment https://forums.phpfreaks.com/topic/85002-solved-which-process-is-faster/ Share on other sites More sharing options...
PFMaBiSmAd Posted January 8, 2008 Share Posted January 8, 2008 Use the mysql WEEK() function in your query to get mysql to output the week for the dateĀ - http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_week Quote Link to comment https://forums.phpfreaks.com/topic/85002-solved-which-process-is-faster/#findComment-433443 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.