Jump to content

php & mysql [programming stuff]


lacroix

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/69702-php-mysql-programming-stuff/
Share on other sites

<?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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.