Jump to content

nezbo

Members
  • Posts

    238
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

nezbo's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Hi all I am tring to sort the content of my forum by the post comments... i.e. i am trying to sort the form by most recent comment... this is my SQL i have so far $result = @mysql_query("SELECT forumID, forumHedder, forumBoddy, dateStamp, userID, email, valid , IF((SELECT TOP 1 timeStamp FROM forum_replies WHERE forum.forumID = forumID ORDER BY timeStamp DESE) = 0, forum.dateStamp, timeStamp) FROM forum WHERE valid=0 ORDER BY dateStamp DESC LIMIT " . $pages . " , 30"); I want to order be the timeStamp FROM forum_replies but not all posts have been responded to so it will need to be check against the main post date forum.dateStamp... Hope this make sence?
  2. I live in the UK, i am within the GMT (with daylight saving time ie 1 hour difrence between summer and winter) Should i be using GMDATE and GMMKTIME or DATE and MKTIME... for all my date and time functions? I have been having a number of problems with page i have been working on with dates. Also does GMMKTIME just minus a hour from the MKTIME over the summer months? the problem i am having, if someone requests a holiday eg in June and the request is made in Jan, since the clocks have gone back these enteries have lost a hour?
  3. How do i get a text box to auto scroll to the bottom and re run the function every second? This is was i have a the moment (by searching google) <script type="text/javascript"> function autoscrole() { theText.selstart = len(theText.TEXT); } setInterval("autoscrole()",1000); autoscrole(); </script> The text box is updated by aJax and it need's to be a disabled text box.
  4. Hi all I a creating a query the gets an [entered date] - 7 days then - 14 days then - 21 days etc... i have this FORMAT(Appointments.[18 Week Start Date], "DD-7/MM/YYYY") FORMAT(Appointments.[18 Week Start Date], "DD-14/MM/YYYY") FORMAT(Appointments.[18 Week Start Date], "DD-21/MM/YYYY") The problem is that when i get to 14 and 21 the amounts are the same Please help Cheers, Neil
  5. Hi all Is there a simple way to count the number of sessions and get there values... eg if there are number of users logged on i want to track who is on line, ie $numberOfUsers = count($_session['user']); then i want to get the session. i am testing it on 2 computers useing difrent session_ID's. I am going to try my best and make the session name "user" unique and not just user once i have it working.
  6. please help me get this to work i have a hour, min, day, month, and year field my database and i want to have it only showing less that mktime() but it is not bringing anythin beck? $getManagerInfo = @mysql_query("SELECT * FROM oncall_staff, person WHERE person.CallID = oncall_staff.userID AND UNIX_TIMESTAMP('oncall_staff.StartDateYears-oncall_staff.StartDateMonths-oncall_staff.StartDateDays oncall_staff.StartDateHours:oncall_staff.StartDateMins:00') < '" . mktime() . "' AND oncall_staff.valid = 0"); while ($getManagerInfo1 = @mysql_fetch_array($getManagerInfo)) { Cheers, Nezbo
  7. Hi all I am trying to get the difrence between 2 date in both decimal format and time format and useing innerHTML post it back to the page. The porblem i cam getting is that the value is not coming back correctly var StartHours = ((StartTimesHoursMin1 < 1000) ? "0" : "") + StartTimesHoursMin1; var StartHours1 = StartHours.substring(2,0); var StartMins1 = StartHours.substring(4,2); var EndHours = ((EndTimesHoursMin1 < 1000) ? "0" : "") + EndTimesHoursMin1; var EndHours1 = EndHours.substring(2,0); var EndMins1 = EndHours.substring(4,2); var curStartTime = new Date(StartYears1,StartMonth1,StaryDays1,StartHours1,StartMins1,00); var curEndTime = new Date(EndYears1,EndMonth1,EndDays1,EndMins1,EndHours,00); var one_day=60*60*24*365; //var curDateTime = Math.ceil((curStartTime.getTime()-curEndTime.getTime())/(one_day)); document.write(((curEndTime.getTime()-curStartTime.getTime())/(one_day))) var curHour = curDateTime.getHours() var curMin = curDateTime.getMinutes() var curTime = ((curHour < 10) ? "0" : "") + curHour + ":" + ((curMin < 10) ? "0" : "") + curMin; var decimalTime = (curHour + curMin/60); document.getElementById("theIHours").value = decimalTime; document.getElementById("hoursANDMins").innerHTML = curDateTime; I am not to sure where i have gone wrong. Please Help Nezbo
  8. I have tried CONCAT and it don't work with SQL Server. Cheers, Anyway Nezbo
  9. I have this code (day(et.receiveStart) + month(et.receiveStart) + year(et.receiveStart)) AS 'Receive call started Date', It makes a whole number e.g. 2013 i am trying to get date of 03/02/2009 i am not to sure how to do this. Nezbo
  10. sorry i will try and explaing a bit more i want to get all the numbers 5 greater and 5 less than a given number I.e. if I have a number 9 the if statement will only allow run if it is 4,5,6,7,8,9,10,11,12,13,14 etc...
  11. Cheers, What is the best way to do this?
  12. hi all i am looking for a function that will give me the numbers + or - 5 from a given number e.g. if ($number +- 5) This runs it the number is + or - 5 Hope this makes sense... Neil
  13. Hi all I have 2 arrays one form the my sql database and on from an array. I have this code so far from the 'split'. if ($_REQUEST['order'] == ""){//Check if there has been any items been added $numberOfItems = 0;//Set the number of items to zero } else{//if items have been added $orderedItems = split(".:.", $_REQUEST['order']);//split item string in to an array $numberOfItems = count($orderedItems);//count the number of items The following code is from the mySQL $getOrderedItemsInfo = @mysql_query("SELECT * FROM ooh_drugs WHERE valid =0"); while($getOrderedItemsInfo = @mysql_fetch_array($getOrderedItemsInfo)) { } I am not to sure where to start, i was looking a foreach loop and i am not to sure how it works, or if it is the correct way to use it. Neil
  14. The working code :: $setVSites = @mysql_query("SELECT * FROM site WHERE Emerg = 1 and valid = 0"); //This is the mysql for getting the sites while ($someVariable = @mysql_fetch_array($setVSites))//convert the mysql object to array { echo "<tr><td>"; $GetLastEntry = @mysql_query("SELECT dental_emerg.userID, dental_emerg.sitePref, dental_emerg.timeStamp, dental_emerg.valid FROM dental_emerg INNER JOIN ( SELECT userID, MAX(timeStamp) as latest FROM dental_emerg GROUP BY userID ) as X ON dental_emerg.userID = X.userID AND dental_emerg.timeStamp = X.latest WHERE dental_emerg.valid = 0"); $numberZero = 0; echo $someVariable['SiteName']; while ($GetLastEntry2 = @mysql_fetch_array($GetLastEntry))//convert the mysql object to array { $splited = split(";", $GetLastEntry2['sitePref']); //this is the split $countSplit = count($splited); //count the number of splits for($i=0; $i <= $countSplit; $i++) { if ($splited[$i] == $someVariable['SiteID']) { $numberZero = $numberZero + 1; } } } echo "</td><td> = " . $numberZero . "</tb></tr>"; }
×
×
  • 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.