Search found 23 matches

by julzk
Sat Jan 16, 2010 11:26 pm
Forum: PHP - Code
Topic: How to calculate total time duration from row results
Replies: 1
Views: 955

Re: How to calculate total time duration from row results

Just so we understand, my sql tables do not have a hours/minutes/seconds field. They are some simple variables that calculate the time duration from the ss_timestart and ss_timeend. When I call $hours and $minutes it simply displays the hours and minutes between ss_timestart and ss_timeend from each...
by julzk
Sat Jan 16, 2010 10:45 pm
Forum: PHP - Code
Topic: How to calculate total time duration from row results
Replies: 1
Views: 955

How to calculate total time duration from row results

Hi, I have a query that display's results from my sql database. I have it listing a start time and an end time. And I have a script that calculates the duration of how long the service was an outage or was just degraded. I am wanting to display a time total, so gathering the row results and the scri...
by julzk
Wed Dec 23, 2009 6:40 pm
Forum: PHP - Code
Topic: Calculate Hours & Minutes between two Dates/Time
Replies: 2
Views: 1877

Calculate Hours & Minutes between two Dates/Time

Hi, I am wanting to Calculate Hours & Minutes between two Dates/Time. I have four fields: ss_datestart, ss_dateend and ss_timestart and ss_timeend. I want to display the hours and minutes between two dates/times. Example: $ss_datestart $ss_timestart --- $ss_dateend $ss_timeend 05-12-2009 13:44:3...
by julzk
Tue Nov 17, 2009 11:37 am
Forum: PHP - Code
Topic: PHP/MySQL Query help with Two Tables
Replies: 16
Views: 1002

Re: PHP/MySQL Query help with Two Tables

WOOOOT!! $result = mysql_query("SELECT             j.jobs_id,             j.jobs_description,             d.jobs_done_id,             d.jobs_timedone,             d.jobs_comment,             d.jobs_user        FROM tbl_jobs AS j        LEFT JOIN tbl_jobs_done AS d            ON j.jobs_id = d.jo...
by julzk
Tue Nov 17, 2009 11:23 am
Forum: PHP - Code
Topic: PHP/MySQL Query help with Two Tables
Replies: 16
Views: 1002

Re: PHP/MySQL Query help with Two Tables

Ahhh.. That may be the problem.. My PHP is passing the correct time/date with set timezone I have further up in my code. But the SQL Server is set to UTC. After running SELECT NOW(), it returned 2009-11-17 12:21:34. So, next step, how to change it? I can't change it on the SQL server itself, so I am...
by julzk
Tue Nov 17, 2009 10:57 am
Forum: PHP - Code
Topic: PHP/MySQL Query help with Two Tables
Replies: 16
Views: 1002

Re: PHP/MySQL Query help with Two Tables

I don't need to change my timezone, it's already changed. When midnight came, the data changed, as it changed to Wednesday, and an extra job appeared in the list as it turned Wednesday, but the existing jobs that were completed were still present. High up, I have my timezone set here: // ##### Date ...
by julzk
Tue Nov 17, 2009 10:37 am
Forum: PHP - Code
Topic: PHP/MySQL Query help with Two Tables
Replies: 16
Views: 1002

Re: PHP/MySQL Query help with Two Tables

I'm in Australia :) It's currently 03:31 AEDT here. The SQL server and the unix box I'm working from are both set to UTC. So you can see what I am talking about, look at this screenshot: http://img697.imageshack.us/img697/6389/jobs.jpg Because the day has rolled over to 2009-11-18 from 2009-11-17, i...
by julzk
Tue Nov 17, 2009 10:14 am
Forum: PHP - Code
Topic: PHP/MySQL Query help with Two Tables
Replies: 16
Views: 1002

Re: PHP/MySQL Query help with Two Tables

That does not quite work. when I add AND d.jobs_date = CURDATE() It's no longer displaying any uncompleted jobs. It's only displaying jobs that are already completed that have the day 2009-11-17 in the jobs_date and jobs_datedone field. However the day right now is 2009-11-18, so my daily jobs page ...
by julzk
Tue Nov 17, 2009 9:58 am
Forum: PHP - Code
Topic: PHP/MySQL Query help with Two Tables
Replies: 16
Views: 1002

Re: PHP/MySQL Query help with Two Tables

I tried your AND statement and it returns the following:

FUNCTION tsdportal.TODAY does not exist

In regards the DATE(), I was trying to experiment :P
My date fields are set as DATE and not DATETIME, so they store only YYYY-MM-DD data.
by julzk
Tue Nov 17, 2009 9:47 am
Forum: PHP - Code
Topic: PHP/MySQL Query help with Two Tables
Replies: 16
Views: 1002

Re: PHP/MySQL Query help with Two Tables

That does not quite work. I tried the following code: (notice my AND statement, similar to your > TODAY()) SELECT     j.jobs_id,     j.jobs_description,     d.jobs_done_id,     d.jobs_timedone,     d.jobs_comment,     d.jobs_user FROM tbl_jobs AS j LEFT JOIN tbl_jobs_done AS d     ON j.jobs_id = d.j...
by julzk
Tue Nov 17, 2009 9:21 am
Forum: PHP - Code
Topic: PHP/MySQL Query help with Two Tables
Replies: 16
Views: 1002

Re: PHP/MySQL Query help with Two Tables

Ok.. I've made some progress.. I've managed to get it to do what I want it to do, but now I'm having another problem. It does the job and appears to be working.. However, I waited for midnight to come to see what happens come the next day. and well, I'm going to cry. It's keeping the same results th...
by julzk
Mon Nov 16, 2009 4:22 am
Forum: PHP - Code
Topic: PHP/MySQL Query help with Two Tables
Replies: 16
Views: 1002

PHP/MySQL Query help with Two Tables

I have an SQL Query question that I'd like help with if possible :banghead: I have two tables "tbl_jobs" and "tbl_jobs_done" Here are the fields for both tables: tbl_jobs -jobs_id -jobs_description -jobs_datestart -jobs_dateend -jobs_datetype -jobs_user -jobs_updateuser tbl_jobs_...
by julzk
Mon Nov 16, 2009 4:18 am
Forum: PHP - Code
Topic: Checkbox Form - Inserting row data from one Table to Another
Replies: 4
Views: 184

Re: Checkbox Form - Inserting row data from one Table to Another

Nevermind, all resolved! :) I worked out my solution :) form checkbox field for each row result from my sql query. <input name='checkbox[]' type='checkbox' value='$jobs_id'> And here's my insert code // ##### Manage Jobs Edit Update DB ##### Start -> if ($_POST[submit] == "Complete") {    ...
by julzk
Sun Nov 15, 2009 11:02 pm
Forum: PHP - Code
Topic: Checkbox Form - Inserting row data from one Table to Another
Replies: 4
Views: 184

Re: Checkbox Form - Inserting row data from one Table to Another

it's a daily job list and re-occurring on set days/weekends/months/everyday for example.. I figure it's going to be easy to have two tables.. one table to store and I can manage/edit/delete jobs. And the second table is to store the completion of jobs. Then I can use the MySQL function to JOIN or IN...
by julzk
Sun Nov 15, 2009 10:21 pm
Forum: PHP - Code
Topic: Checkbox Form - Inserting row data from one Table to Another
Replies: 4
Views: 184

Checkbox Form - Inserting row data from one Table to Another

This is driving me crazy. I have been trying to work this out for weeks and cannot get my head around it. any help would be greatly appreciated!! :) I have two tables "tbl_jobs" and "tbl_jobs_done". I have an SQL query which displays and formats my daily job list from tbl_jobs SQ...