nick5449 Posted July 4, 2006 Share Posted July 4, 2006 I'm new to php and have a few questions. I want to have a page on my website where people can leave messages. Can I simply do this with arrays in php or do I need to use a mysql database? If I do need a database, do I need any extra software or can I just use a basic text editor and upload the code to the server? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/13618-array-or-database/ Share on other sites More sharing options...
Barand Posted July 4, 2006 Share Posted July 4, 2006 An array only exists while the current script is running. You are going to have to store the messages somewhere, either in a database table or in a text file (flat file).A simple text editor will suffice but it's a lot better to use a specialist code editor.Have a look at http://www.php-editors.com Quote Link to comment https://forums.phpfreaks.com/topic/13618-array-or-database/#findComment-52783 Share on other sites More sharing options...
.josh Posted July 4, 2006 Share Posted July 4, 2006 arrays do nothing for permanently storing values (such as messages from people). yes, you would need to have a database that holds it, or at least store the information in a flatfile (like a text file). database option: it depends on what your hosting package is. do you buy hosting from someone, or do you have your own computer setup as a server? hosting packages usually always include the ability to setup at least one database. the software is already on their server. Go to cpanel or contact your hosting provider for help. flatfile option: you would basically have a seperate file in your directory. you would then use php to open the file and get the contents and display it. if someone posts a new message, it would open the same file and add the new message into the file. Quote Link to comment https://forums.phpfreaks.com/topic/13618-array-or-database/#findComment-52785 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.