For anyone who looked at my code on my last post thanks. I'm gonna use a few arrays and functions to reduce the code and see what happeens than.
Now I have another question for you all. It seems simple enough but my head is killing me so I'm trying not to think right now. I have information enetered into a database seperated by commas. Now when I want to retrieve this I want their to be a <br> tag wherever a comma occurs. Any tips for me? Thanks in advance.
Retrieveing info from MySql Database
Moderator: General Moderators
Code: Select all
<?php
#fetch the result of your query
$row = mysql_fetch_assoc($result);
#set the value of the my_text var to your text
$my_text = $row['my_text_field'];
#now replace all commas with <br />s
$my_text = str_replace(',', '<br />', $my_text);
?>Edit: added a missing $
Wow my head really does hurt
Man My brain really does hurt. I was reading about that function last night and forgot. Thanks!