Hello I have already seen a question about this and my code is optimized to do the same thing Have tried to. Basically I have a field in my mysql database whose date should be dd-mm-yyyy in this format yyyy-dd-mm. Currently my code line resonates
and it reads a parsus error: syntax error, unexpected T_STRING, ',' or ';' It is not certain how to fix any idea.
$ result = mysql_query (select "dbGigs" where string () and date "date"); table class = \" gigs \ "& gt; & lt; tr & gt; & lt; th & gt; location & lt; / th> & lt; th & gt; city & lt Th & gt; & lt; / tr & gt; "; While ($ line = mysql_fetch_array ($ result)) {resonant "<<"; Echo "& lt; td> & lt; strong & gt;" . $ Line ['place'] "& lt; / strong> gt; & lt; / td & gt;"; Echo "& lt; td> & lt; strong & gt;" . $ Line ['city'] "& lt; / strong> gt; & lt; / td & gt;"; Echo "& lt; td & gt; strong & gt; (" d / m / y "," line row ['date']. ") & Lt; / strong & gt; & lt; / td & Gt; "; Echo "& lt; td> & lt; strong & gt;" . $ Line ['time'] "& lt; / strong> gt; & lt; / td & gt;"; Echo "& lt; td> & lt; strong & gt;" . $ Line ['status']. "& Lt; / strong> "; Echo "& lt; / tr & gt;";
first things first
echo " ; TD & gt; Strong & gt; ("d / m / y", ". $ Line ['date'].") & Lt; / strong & gt; & lt; / td & gt; ;
This line looks incorrect; I suspect that it should
echo " & lt; strong>. Date (" d / m / y ", $ line ['date']) "& Lt; / Strong> & Lt; / TD & gt; "; Note the missing function call and cockatatenation operator, by coincidence, while it is syntactically correct (as far as I can see), whatever Depending on what you see, what is the $ row ['date']
actually included - it is necessary to have a Unix timestamp for date ()
To get the date as a Unix timestamp, you should select the MySQL function You can use
SELECT *, UNIX_TIMESTAMP (date) AS date_ts FROM ...
You can again $ row ['Date_ts']
can be reached in normal form, and pass it in the function for formatting date ()
. Alternatively, you get back to get the timestamp from that You can use something to parse the current value returned.
The MySQL format for another option is to use the date, its function Again, you can get this value back from the query and print it.
Comments
Post a Comment