Page 1 of 1

News

Posted: Fri Jun 06, 2008 3:55 am
by Zombar
Hi Everyone,

on my project I have a little "News" window. Every now and then I want to put something new on there. Since the same news window is on every page and identical, I would like to generate an admin page with a textfield and a submit button. I want the script to update the information to a central location (file/db/whatever) and the News window the to load it from there. I tried googeling it but I don't even know what to look for :dubious: . Any ideas??

Thanks You Guys

Re: News

Posted: Fri Jun 06, 2008 9:02 am
by vargadanis
This is the way to ask. You included everything we need to help you.
What you are looking for is an application, most likely written in PHP, which will connecto to a database and reads it or writes it in case you want to add something to it. The database is called MySQL. (There are other versions, PgSQL, SQLite etc. but this one is the most often used)
You will have to set up a table. A table have columns and rows. The colums have a name eg: id, text, email_address. In the rows if there is a data, it is called a field. So what you need to do is creating a 2 fields. One with a unique identifier for the text (2. field). Something like this

Code: Select all

    id    text
--|-----|---------------------
1.|  1  | Text of news
2.|  4  | Text of another news
 
ID is important because you will refer to the text not by the text but the ID which is a simple number. Field have datatypes. ID needs to be an integer and text mucst be text or longtext.

With php, you need to connect to the database and read the data out from it and then display it.
php.net/mysql_connect