tradet Posted September 20, 2008 Share Posted September 20, 2008 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 More sharing options...
Mchl Posted September 20, 2008 Share Posted September 20, 2008 What do you mean by 'doesn't work'? Date is not showing, or you get errors? What is being shown when you do echo $row_q_blog['date_entered'] ? Link to comment https://forums.phpfreaks.com/topic/125068-beginner-php-prob-date-related/#findComment-646339 Share on other sites More sharing options...
tradet Posted September 20, 2008 Author Share Posted September 20, 2008 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? Link to comment https://forums.phpfreaks.com/topic/125068-beginner-php-prob-date-related/#findComment-646344 Share on other sites More sharing options...
tradet Posted September 20, 2008 Author Share Posted September 20, 2008 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!! Link to comment https://forums.phpfreaks.com/topic/125068-beginner-php-prob-date-related/#findComment-646457 Share on other sites More sharing options...
tradet Posted September 21, 2008 Author Share Posted September 21, 2008 Nobody? Adding the bogus query solved all my pages except my 'view monthly posts' which has a lot of date functions... I'm at a complete loss here. Maybe it's something to do with me using 'mysql_pconnect'? Link to comment https://forums.phpfreaks.com/topic/125068-beginner-php-prob-date-related/#findComment-646935 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.