Eminem Posted June 16, 2007 Share Posted June 16, 2007 I have a form on my site that submits content to my homepage and I have a question. How can I have PHP submit a time in the database for each submission? Is there a function for this? Quote Link to comment https://forums.phpfreaks.com/topic/55876-solved-php-time/ Share on other sites More sharing options...
Pastulio Posted June 16, 2007 Share Posted June 16, 2007 the function you want to use is either time() http://www.php.net/time or date() http://www.php.net/date Quote Link to comment https://forums.phpfreaks.com/topic/55876-solved-php-time/#findComment-276038 Share on other sites More sharing options...
Eminem Posted June 16, 2007 Author Share Posted June 16, 2007 Thanks. Another thing, in the PHP form -- how can I get the PHP to automatically convert carriage returns to HTML line breaks? Like how would I get this: hello world To look like this: hello world Instead of like this: hello world Any ideas or something? Quote Link to comment https://forums.phpfreaks.com/topic/55876-solved-php-time/#findComment-276049 Share on other sites More sharing options...
AndyB Posted June 16, 2007 Share Posted June 16, 2007 Another thing, in the PHP form -- how can I get the PHP to automatically convert carriage returns to HTML line breaks? http://ca.php.net/manual/en/function.nl2br.php Quote Link to comment https://forums.phpfreaks.com/topic/55876-solved-php-time/#findComment-276052 Share on other sites More sharing options...
Pastulio Posted June 16, 2007 Share Posted June 16, 2007 use the function nl2br() http://be.php.net/nl2br or str_replace() http://be.php.net/manual/en/function.str-replace.php first one is the fastest. Quote Link to comment https://forums.phpfreaks.com/topic/55876-solved-php-time/#findComment-276054 Share on other sites More sharing options...
Eminem Posted June 16, 2007 Author Share Posted June 16, 2007 Thanks, everyone! Now, is there a way to get some html after each result when something is listed from the database? Like this: $result = mysql_query("SELECT * FROM something"); while($row = mysql_fetch_array($result)) { echo $row['title']; } Shows: Title1Title2Title3Title4Title5 I want there to be a <img src="something.png"> after something is listed like this: Title1<img src="something.png">Title2<img src="something.png">Title3<img src="something.png">Title4<img src="something.png">Title5<img src="something.png"> How can I do this? Quote Link to comment https://forums.phpfreaks.com/topic/55876-solved-php-time/#findComment-276074 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.