automatic select form a db if something is posted

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Grandiozo
Forum Newbie
Posts: 1
Joined: Thu Oct 17, 2002 8:33 am
Location: The Netherlands/Sliedrecht

automatic select form a db if something is posted

Post by Grandiozo »

hey everyone,

I'm busy with learn php & mysql. I'm now busy with a guestbook.
I can post messages into my database.
I've read a lots of articles (dutch), but I haven't find it.
How can I automatic show a message?
Now I muss add the message self, but I want that it happen automatic. So, somebody post a message and than automatic will be the message add on a page...
Where can I find a script (English or Dutch) or who can write a script for me?
If you want help me, thank you very much!!
For MSN you can contact me on grandiozo@hotmail.com

Greets,

Edwin
User avatar
Phirus
Forum Commoner
Posts: 37
Joined: Thu Apr 18, 2002 4:10 pm
Contact:

Post by Phirus »

Erm..Unless you have flagged it on a certain field in the DB, All you should do is:

Code: Select all

<?php

$sqry = mysql_query("SELECT field_names FROM table_name");

?>
Then you loop out the data from the DB:

Code: Select all

<?php

while($result = mysql_fetch_array($sqry)){

echo $resultї'WHATEVER_YOUR FIELD NAME IS IN THE DB'];

}

?>

Hope you understand,

Phirus
Post Reply