How do I get the hour (24 hour format) from a stored Time value

I have a field called start_time in a mysql database and all I need to do but unable to do so far is extract the hour in 24 hour format (no leading zeros) from this field.  I have tried all the date functions including date('G'), getdate and start_time[hours] array.
I keep getting either todays date & time, or just he first digit in the hour.
The following is the closest it has come to working but this is the on ethat is return just the first digit of the hour if there is two digits in the 24 hour format (ex:  2 pm = 14, it returns oly the 1)
<?php
$start_time = $row['start_time'];
$hour = $start_time[hours];
?>
PLEASE HELP !  I have spent too much time on such a menial task.  I think part of my problem is I am running PHP 4.
Thanks in advance,
Marcus

Thanks for the response David:
Do you mean like the following ?  I don't seem to get a value
<?php
     mysql_select_db($dbname,$link_id);
      $lookup = "SELECT * FROM $tbl";
      $result = mysql_query($lookup);
          while ($row = mysql_fetch_array($result))
                $query = "SELECT HOUR(start_time) AS start_hour FROM $tbl";
                $rslt = mysql_query($query);
                $hour = $row['start_hour'];                  //  I tried using $rslt['start_hour']; as well and that did not work either
               echo $hour;
?>
I'm sure its something elemtary I'm missing now.
Any help is always appreciated David.
Marcus

Similar Messages

  • HT1473 I have 2 computers, one in the US and one in Canada. My US computer has about 3000 songs from both iTunes and CDs. When I sync my iPhone only the iTunes music is synced to my Canadian computer. How do I get the balance of music synced from the phon

    I have 2 computers, one in the US and one in Canada. My US computer has about 3000 songs from both iTunes and CDs which are synced on my phone. When I sync my iPhone in Canada only the iTunes music is synced to my Canadian computer. How do I get the balance of music synced from the phone?

    Follow the steps given here
    https://discussions.apple.com/docs/DOC-3141

  • TS1702 Hi i lost my iphone and have since bought a new one. How do I get the apps i had back from my old phone? Thanks

    Hi I lost my iphone and have since replaced it. How do I get the apps back that I had on my old phone? I did not get to sync my phone to itunes before i lost it. Thanks

    Read here:
    http://support.apple.com/kb/HT2109

  • How do I get the Jam Pack instruments downloaded from mainstage 3 to show up in Garageband '11?

    I downloaded and installed Mainstage 3 to be able to download the jam pack instruments and loops that come with it and use them in Garageband '11. I read that I can use the software instruments in the program, however none of the jam packs I downloaded show up in the list of software instruments in Garageband.
    I clicked on the menu which tells me if I want to display 'Garageband','my settings' or 'All' of the instruments, but no 'Jam Pack' option shows up.
    how do I get the jam pack instruments to show up in Garageband? I want to know how you import the instruments in the program.

    It looks like nobody here is already using Mainstage 3 with GarageBand, since there is no need to upgrade from mainstage 2 while it is still working. What you are reading here on Mainstage, JamPacks, and GB has been tested with Mainstage 2 but not 3.
    Did you download all contents for Mainstage? WIth Mainstage 2 the JamPAcks were part of a separate download. Launch Mainstage 3, and check, if there is a menu entry somewhere that will let you download additional contents. If you do not see any JamPacks directly, they may be bundled with "Logic" or "Legacy" items.
    In Mainstage 2 it looks like this. Your version probably has a different panel.
    Once everything has been installed, reboot.

  • How do I get the pictures of app icons from being blank?

    Lately half of my app icons are blank. How do I get the pictures back?

    - Have you tried resetting yuor iPod.  Nothing will be lost:
    Reset iPod touch:  Press and hold the On/Off Sleep/Wake button and the Home
    button at the same time for at least ten seconds, until the Apple logo appears.
    - Next would be to restore you iPod.

  • How we can get the output in excel format for Spawned programs?

    My requirement is to get the excel output for some of the programs (like -Adjustment Register, Applied Receipts Register). I am trying to achieve this by BI Publisher. But these programs has "Spawned" executable. And when I am changing the output type as"XML" I am getting below error in output-
    "XML Parsing Error: syntax error"
    Can anyne suggest how we can get an XML output and then excel output for Spawned programs?
    Thanks in advance,

    Hi,
    If I get it right, you want to convert RXi (Reports Exchange) reports such as Adjustment Register & Applied Receipts Register into XML Publisher. Normally, you need to change the "Output Format" of the program called by the "Spawned" program to 'XML' -- not the "Spawned" program itself.
    However, I believe RXi reports does not support XML output (atleast in 11i). It could only work on Text & Html format. Check on the metalink note below:
    432719.1 - RXi-Only Reports Generate XML Format Exception With No Output Setting the Output Format to XML
    Hope this helps.
    regards,..
    Rownald

  • How can i get the SQL of a tablespace from the database

    Hello All,
    I am using Oracle 11g R2. I want to get the SQL of some tablespaces on my database. in the same way i get the DDL of the table using the GET_DDL function.
    How can i get that ?
    Regards,

    try this please
    select dbms_metadata.get_ddl('TABLESPACE',tb.tablespace_name) from dba_tablespaces tb;or
    select 'create tablespace ' || df.tablespace_name || chr(10)
    || ' datafile ''' || df.file_name || ''' size ' || df.bytes
    || decode(autoextensible,'N',null, chr(10) || ' autoextend on maxsize '
    || maxbytes)
    || chr(10)
    || 'default storage ( initial ' || initial_extent
    || decode (next_extent, null, null, ' next ' || next_extent )
    || ' minextents ' || min_extents
    || ' maxextents ' ||  decode(max_extents,'2147483645','unlimited',max_extents)
    || ') ;'
    from dba_data_files df, dba_tablespaces t
    where df.tablespace_name=t.tablespace_name Edited by: Mahir M. Quluzade on Mar 14, 2011 4:51 PM

  • How do i get the selected index in jsp from a select "in the same page!!!"

    i dont if it si possible but i want to get the selected index form a select implmenting javascript jsp an html something like this:
    html:select property="slcLocation" onchange="updateList(this.form)">
    <% for (int i=0; i< user.getNumLocaliza();i++)
    out.println("<option selected>" + user.getLocation(i,1));
    %>
    </html:select> </div></td>
    ...

    i try it in the same page but it fails, the code is:
    <html:select property="slcLocation" onchange="document.location.href='cajaApertura.jsp?slcLocation='+this.options[this.selectedIndex].value">
    <%
    for (int i=0; i< user.getNumLocaliza();i++)
    out.println("<option>" + user.getLocation(i,1));
    %>
    </html:select>
    </div></td>
    </tr>
    <tr>
    <td><div align="left"><font size="1"><strong><font color="#FFFFFF" face="Verdana, Arial, Helvetica, sans-serif">Caja:</font></strong></font></div></td>
    <td bgcolor="#C4B4F3"><div align="center">
    <html:select property="slcCaja" onchange="document.location.href='cajaApertura.jsp?asdf='+this.options[this.selectedIndex].value">
    <%
    int caja;
    if (request.getParameter("slcLocation")!=null)
    //for (int i=0; i< cajaLocation.getNumCajas (request.getParameter("slcLocation"));i++)
    for (int i=0; i< 3;i++)
    caja = i+1;
    out.println("<option> Caja p " + caja + request.getParameter("slcLocation"));
    }else
    for (int i=0; i< cajaLocation.getNumCajas (user.getLocation(0,1));i++)
    caja = i+1;
    out.println("<option> Caja " + caja);
    %>
    </html:select>
    is this correct? what is my mistake?
    tnks for your help

  • How can i get the stack of one thread from another thread

    hi !
    i have a pool threads ,some times all therads in that pool are besy becouse somting lock the threads so there is no free thread to handle ... .
    what i want is a way to get the stack of these thread so i can print them to see way they lock ...
    thanks,
    zvika

    Maybe something like this (haven't actually tried it):
    Add a method to your Threads to print the trace:
    public class MyThread extends Thread {
        public void run() {
        public void printCurrentStack() {
            (new Exception()).printStackTrace(); // or whatever method you choose
    MyThread mt = new MyThread();
    mt.start();
    mt.printCurrentStack();

  • How can I get the OS short date format?

    I want to get the format of OS computer in java.
    somthing that return to me:
    yyyy/MM/dd
    or
    MM/dd/yyyy
    og
    dd/MM/yyyy
    Thanks and have a nice weekend!

    DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT);
                   Date date = new Date();
                   System.out.println("The short date is : " + df.format(date));OR you can specify which format you want
    DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
                   Date date = new Date();
                   System.out.println("The short date is : " + df.format(date));Message was edited by:
    SomeoneElse

  • How do i stop the plug in update page from showing every time i start firefox? all are green and updated...

    plugin update page appears every time I open firefox. All of the plugin updates are green.

    i downloaded and restarted version 18 and still get the plug in page loading it is driving me crazy if i don't find a solution fast i am getting rid of what used to be a great browser hope some one can help me

  • How do I get the greeting card function to work? Every time I try to open it I get an error message?

    How do I create a greeting card? Everytime I click on the greeting card option under create I get an error message about size. I have never used or tried to use it before.

    Try this, for starters:
    http://helpx.adobe.com/photoshop-elements/kb/error-valid-size-available-creation.html

  • When I close the CHM how do I get the application it was launched from to regain focus?

    I am developing a CHM for an application that runs on
    Windows. When I launch the Help (CHM) from the application, then
    close the Help, I want the application that I launched the Help
    from to regain focus. (I would expect this is what most people
    would want to happen, and this is what happens with Microsoft
    generated Help files.) However with my RoboHelp CHMs this does not
    happen.
    Does anyone know how I can fix this behaviour? Is there a
    setting in RoboHelp that I need to change?
    My R&D application developer has spoken with Microsoft
    and they suggested the problem was with my RoboHelp CHM, they
    suggested trying the following process with one of their CHMs and
    then with one that I created using RoboHelp, and they are correct
    in that my RoboHelp CHM is behaving differently. Here's the
    procedure if you'd like to try it:
    - Open a Windows Explorer window.
    - Navigate to the c:\WINDOWS\Help folder (or equivalent on
    your PC).
    - Double-click on the iexplore.chm file. Note that the help
    file opens up in a viewer window.
    - Dismiss the viewer by clicking on the close button (X).
    - Note that focus is returned to the Windows Explorer window.
    Repeat the above experiment, but navigate to where you have a
    RoboHelp CHM file. I find that when I dismiss the help viewer
    window, focus is NOT returned to the Windows Explorer window. Do
    you see the same thing with your RoboHelp CHMs? If not, what have
    you set to cause the application that it was launched from to
    regain focus?
    I really appreciate any help you can give me in resolving
    this issue.
    Best Regards, Sharon

    Hi Sharon
    Hmmm, where exactly *IS* the focus in your tests after
    closing the RoboHelp generated .CHM file? I just tested and saw the
    same behavior regardless of whether it was a Microsoft .CHM or a
    RoboHelp HTML created .CHM. Each time, the focus was returned to
    Windows Explorer.
    I do know that the manner in which your developers open a
    .CHM can vary. For example, your developer can specify that a
    particular tab have focus, such as the Index or TOC, while simply
    double-clicking will result in the last opened tab being the active
    tab.
    Wish I had more to offer here, but I'm not seeing the same
    behavior as you are. I do know there are some extended settings for
    your window, but I'm doubtful that's the answer here.
    Also, I'm not too sure how much stock I'd put in something a
    Microsoft call center stated. Just the nature of call centers. Some
    folks that staff them are good and skilled, some are a bit, shall
    we say, lacking. This is truly "Luck of the draw".
    Sincerely... Rick

  • How do I get the music I've copied from CDs to sync to my iPhone?

    I have lots of music on on my computer that I have loaded from my CD collection.  They sync to my ipod, but I can't figure out how to get them on my phone. My husband didn't have this problem syncing his phone and computer but we can't figure out what is different that is blocking my phone from getting my tunes.
    Any suggestions?
    I have a Verizon iPhone

    See Recover your iTunes library from your iPod or iOS device.
    tt2

  • How do I get the screensavers to stop loading from iphoto and remove the ones now in screensaver?

    How do I remove photos from screensaver and get them to stop importing from wherever in my computer they are importing from?

    Apple Menu / System Preferences / Desktop & Screen Saver. Select Screen Saver and click on what you want. There probably is a "slide show" selected.
    You can turn it off by setting Start After: Never.

Maybe you are looking for