Barand Posted February 28, 2007 Share Posted February 28, 2007 Identical to your last post ??? Link to comment https://forums.phpfreaks.com/topic/40421-solved-mysql-php-problem/page/2/#findComment-195666 Share on other sites More sharing options...
pocobueno1388 Posted February 28, 2007 Share Posted February 28, 2007 Are you talking to me Barand? I added the while loop in there...nothing to drastic, but it was a change. Link to comment https://forums.phpfreaks.com/topic/40421-solved-mysql-php-problem/page/2/#findComment-195667 Share on other sites More sharing options...
jadedknight Posted February 28, 2007 Author Share Posted February 28, 2007 Wow! Thank you guys so much, you have been so helpful haha. Man it works ok this is my code now.. $query="SELECT * FROM posts"; $result=mysql_query($query); while ($row = mysql_fetch_assoc($result)){ echo $row['id'].'<br>'; echo $row['title'].'<br>'; echo $row['author'].'<br>'; echo $row['date'].'<br>'; echo $row['content'].'<br>'; } I just want to make sure thats correct code to use. Link to comment https://forums.phpfreaks.com/topic/40421-solved-mysql-php-problem/page/2/#findComment-195668 Share on other sites More sharing options...
pocobueno1388 Posted February 28, 2007 Share Posted February 28, 2007 You could clean it up a bit... <?php $query="SELECT * FROM posts"; $result=mysql_query($query); while ($row = mysql_fetch_assoc($result)){ echo $row['id']; echo $row['title']; echo $row['author']; echo $row['date']; echo $row['content']; } ?> EDIT: Oh, I just relized that you may have just wanted to space them out with the ''. <?php $query="SELECT * FROM posts"; $result=mysql_query($query); while ($row = mysql_fetch_assoc($result)){ echo $row['id'].' '; echo $row['title'].' '; echo $row['author'].' '; echo $row['date'].' '; echo $row['content'].' '; echo '<p>'; } ?> Link to comment https://forums.phpfreaks.com/topic/40421-solved-mysql-php-problem/page/2/#findComment-195674 Share on other sites More sharing options...
jadedknight Posted February 28, 2007 Author Share Posted February 28, 2007 Yeah for some reason the <br> tags didnt copy and paste..etc, one last thing When I use that, all the post information is all mushed together, where to I insert a break to separate each post. Link to comment https://forums.phpfreaks.com/topic/40421-solved-mysql-php-problem/page/2/#findComment-195676 Share on other sites More sharing options...
Barand Posted February 28, 2007 Share Posted February 28, 2007 You could clean it up even more - see my reply #21 above Link to comment https://forums.phpfreaks.com/topic/40421-solved-mysql-php-problem/page/2/#findComment-195678 Share on other sites More sharing options...
pocobueno1388 Posted February 28, 2007 Share Posted February 28, 2007 The second code of my last post should fix that for you =) Link to comment https://forums.phpfreaks.com/topic/40421-solved-mysql-php-problem/page/2/#findComment-195679 Share on other sites More sharing options...
pocobueno1388 Posted February 28, 2007 Share Posted February 28, 2007 Oh, I see what you are saying Barand. I just wanted to give her something a little more simple than that just because she is newer and it would help her understand better. I am glad you posted that code though, it works beautifully and I hope you don't mind if I use it when I am coding Link to comment https://forums.phpfreaks.com/topic/40421-solved-mysql-php-problem/page/2/#findComment-195685 Share on other sites More sharing options...
jadedknight Posted February 28, 2007 Author Share Posted February 28, 2007 YES! Wow thank you so much! *tears* lol. Man you guys rock. This is my first day here and already so much positiveness lmao. I will be back hopefully to help Link to comment https://forums.phpfreaks.com/topic/40421-solved-mysql-php-problem/page/2/#findComment-195687 Share on other sites More sharing options...
pocobueno1388 Posted February 28, 2007 Share Posted February 28, 2007 Everyone here is happy to help you XD Make sure to set this topic as "solved". Link to comment https://forums.phpfreaks.com/topic/40421-solved-mysql-php-problem/page/2/#findComment-195689 Share on other sites More sharing options...
Barand Posted February 28, 2007 Share Posted February 28, 2007 I am glad you posted that code though, it works beautifully and I hope you don't mind if I use it when I am coding Feel free to use it. For greater functionality there's also the baaGrid link in my sig. Link to comment https://forums.phpfreaks.com/topic/40421-solved-mysql-php-problem/page/2/#findComment-195694 Share on other sites More sharing options...
pocobueno1388 Posted February 28, 2007 Share Posted February 28, 2007 Great =D Thanks Link to comment https://forums.phpfreaks.com/topic/40421-solved-mysql-php-problem/page/2/#findComment-195702 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.