Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6153193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:03:09+00:00 2026-05-23T20:03:09+00:00

This is my PHP/MySQL query, as mentioned at Displaying links in PHP/MySQL? : http://pastebin.com/5Td9Bybn

  • 0

This is my PHP/MySQL query, as mentioned at Displaying links in PHP/MySQL?:

http://pastebin.com/5Td9Bybn

I’ll admit, I’ve forgotten how to use the strtotime() function effectively, as I want to show my show times in this format:

06:00

10:00

(without the :00 at the end, e.g. 10:00:00)

The code displays this error now:

Parse error: syntax error, unexpected T_ECHO in C:\www\vhosts\localradio\schedsun.php on line 11

I’ve fixed the errors in the previous question, how could I adapt this if I wanted to show the time as:

6:00am

06:00

6am

(just for testing sake, within the parameters of the code on Pastebin).

I’m basically asking simply as I’m doing my own refresher course in other parts of PHP, having spent so long learning arrays etc.

Finally, do I need as a variable or not – or is $result_ar not needed?

Thank you for your help on the last question!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T20:03:10+00:00Added an answer on May 23, 2026 at 8:03 pm

    You can do it directly in MySQL, which saves you the overhead of strtotime()’s parseing overhead, and guaranteed to produce the right results, as strtotime can guess wrong occasionally.

    SELECT DATE_FORMAT(yourdatefield, '%h:%i') ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a query like this (Mysql 5.X, PHP - formatted for legibility) $query
I found this: http://www.evolt.org/failover-database-connection-with-php-mysql and similar examples. But is there a better way? I
this is my .java HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(http://*******.com/mobileproject/updateclass.php);
5 star rating script I have is made based on this tutorial http://php.about.com/od/finishedphp1/ss/rating_script.htm I
following the answers i got on this thread PHP MySQL Query to get most
I am trying to echo a variable, from a mysql query, like this: <?php
So i have this script: <?php $query = mysql_query( SELECT meetup AS text, id
IS this bit of code in PHP/mysql considered a stored procedure? $sql = 'SELECT
I am putting my php /mysql website up and this is my scenario The
Php novice. 1.Is there anything wrong with this PHP & MySQL code? include_once db_login.php

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.