lacroix Posted September 17, 2007 Share Posted September 17, 2007 Need help here. [php/mysql] I am a noobie...(real noobie, no joke!) If I have a database : date description user_id ip_addr data_id How do I code to make it display like a blog system e.g: This is sumthing like a data entry system where the supervisor will input the movement/chronology for the staff and work done on a certain task. The date, time, ip_adr and name will be automatically inserted at the instance of editing the work data. Its hard for me to show here because I'm a noobie and just getting the hang on programming. I guess it is much or less like a blogging system. Quote Link to comment https://forums.phpfreaks.com/topic/69702-php-mysql-programming-stuff/ Share on other sites More sharing options...
pocobueno1388 Posted September 18, 2007 Share Posted September 18, 2007 <?php $query = "SELECT date, description, user_id, ip_addr, data_id FROM table"; $result = mysql_query($query)or die(mysql_error()); while ($row = mysql_fetch_assoc($result)){ echo $row['date'].'<br>'; echo $row['ip_addr'].'<br>'; echo $row['description'].'<p>'; } ?> That will display the data like you listed above. You might have to format your date/time how you want it, I'm not sure how you have that stored in the DB. Quote Link to comment https://forums.phpfreaks.com/topic/69702-php-mysql-programming-stuff/#findComment-350223 Share on other sites More sharing options...
lacroix Posted September 18, 2007 Author Share Posted September 18, 2007 Thanks... will try this... Quote Link to comment https://forums.phpfreaks.com/topic/69702-php-mysql-programming-stuff/#findComment-350333 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.