Jump to content

Beginner php prob, date related


tradet

Recommended Posts

Hello

 

I'm new to this forum and web design in general and now I have this strange problem.

 

I have this working on my home page:

$date = strtotime( $row_q_blog['date_entered'] );
$date = date('F j, Y', $date);
echo $date.

 

But on another page it just doesn't work, I had to comment out date and strtotime to make it work:

//$date = strtotime( $row_q_blog['date_entered'] );
//$date = date('F j, Y', $date);
//echo $date.
echo $row_q_blog['date_entered'].

 

I'm new to php and all but this just is very strange...

 

Didn't know what to use to show the whole files but here they are:

home page

 

Faulting lines are on 77-79, 104-106 and 135 (commented out)

other page

 

Really appreciate any help!

Link to comment
https://forums.phpfreaks.com/topic/125068-beginner-php-prob-date-related/
Share on other sites

With doesn't work I mean I get the banner, the side links but the php code and everything underneath it won't show ex the footer. Just blank.

 

echo $row_q_blog['date_entered'] gives a date from the server like '2008-09-19'.

 

Everything worked fine when I used my own apache/mysql server but now I've uploaded the site to a web hosting company and now I have these problems. Dunno... maybe some settings or?

I messed around a bit in another file, smaller but with the same problem. Using the first working page I managed to make it work... but with an extra bogus query!

 

Check

 

This works! But if I comment out

$bogus = mysql_query("SELECT * FROM comments", $bumhome) or die(mysql_error());

which for the lazy ones is directly below

while($row_q_blog = mysql_fetch_assoc($q_blog)) {

it stops giving no output after that point!!

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.