473,385 Members | 1,893 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Implementing a Basic CMS

27
Hi all,

I am new to PHP. I am trying to develop an html page that will list names of people and there will be some information corresponding to each name. What I am trying to achieve is to somehow incorporate those names under variables and/or arrays so I can change them from CMS. i will need to be changing the names as well as the number of names (sometimes there will be 10 other times 12...etc) Please advise me on how to proceed? What is the most effective way to code it?...with variables or arrays? I will appreciate any suggestions.

Thanks in advance!
Jun 27 '07 #1
5 1127
Atli
5,058 Expert 4TB
Hi.

I'm not sure what you mean by CMS?

When you'r dealing with information like this, you will need a good place to store it. A database would be ideal, but there are of course other, less sophisticated methods. PHP by it's self can not store data.

I would use a MySQL database to store my information, which I would then use in my PHP code to display or edit the information as needed.

If you are not sure how to do this, there are plenty of free tutorials online.
And as always, we are more than happy to help you out.
Jun 27 '07 #2
bettor
27
Hi.

I'm not sure what you mean by CMS?

When you'r dealing with information like this, you will need a good place to store it. A database would be ideal, but there are of course other, less sophisticated methods. PHP by it's self can not store data.

I would use a MySQL database to store my information, which I would then use in my PHP code to display or edit the information as needed.

If you are not sure how to do this, there are plenty of free tutorials online.
And as always, we are more than happy to help you out.
Thank you for your advice. It is good help as a beginning. Now I need some advice on how to store the names and the info associated with them so I can change it and display it whenever I need to, from an admin panel (CMS). Since I will be using certain names of a group of people i was thinking to assign a variable for each name...but I will have to assign many variables. And every time i will need to display different names from that group (that's why i'm thinking variables could help) What would be my best option to store all the names so I can recall some of them at certain periods? Thanks for your advice
Jun 27 '07 #3
bonski
53
Thank you for your advice. It is good help as a beginning. Now I need some advice on how to store the names and the info associated with them so I can change it and display it whenever I need to, from an admin panel (CMS). Since I will be using certain names of a group of people i was thinking to assign a variable for each name...but I will have to assign many variables. And every time i will need to display different names from that group (that's why i'm thinking variables could help) What would be my best option to store all the names so I can recall some of them at certain periods? Thanks for your advice
ei bettor,

in mysql database.. you can make queries that will insert, edit, delete, search data.. you can add the data directly to database using mysql commands.. or you can use phpmyadmin... or you can make your own front end using PHP.. by having html forms where you input your data and a php scripts to process them the way you want... after adding you data to the database.. on you frontend.. you can make a script that will query them and display them... i suggest you read books about php and mysql... or look for tutorials... then if you had started coding and facing problems.. you can post it... so everybody here will have a chance to help you... ok

^____^... bonski..
Jun 27 '07 #4
Atli
5,058 Expert 4TB
Well, if you were to use a database, you could set up a table where you can store all that data.

You could set up a user table that looked similar to this:
Expand|Select|Wrap|Line Numbers
  1. Table: UserData
  2. ----------------------------------------------------------------
  3. ID   UserName    UserPassword  UserEmail          UserPhone
  4. ----------------------------------------------------------------
  5. 1    User1       Randomness    user1@domain.com   1234567
  6. 2    User2       KnockKnock    user2@domain.com   2234567
  7. 3    User3       Who's ther?   user2@domain.com   3234567
  8. 4    User4       You'r moma!   user3@domain.com   4234567
  9.  
Then you could use SQL queries to read and edit the data. For example, to list all data that belongs to 'User1' you could use this SQL:
Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM UserData WHERE UserName = 'User1';
  2.  
Which you could have PHP execute and fetch the results, and display them like this:
Expand|Select|Wrap|Line Numbers
  1. // Connect MySQL
  2. $DB = mysql_connect("serverIP", "userName", "userPass") or die("MySQL connection failed:<br />". mysql_error());
  3. mysql_select_db("yourDB", $DB) or die("Database could not be selected: <br />". mysql_error());
  4.  
  5. // Query for the data
  6. $RESULT = mysql_query("SELECT * FROM UserData WHERE UserName = 'User1'");
  7.  
  8. // Loop through each row
  9. $rowIndex = 0;
  10. while($row = mysql_fetch_assoc($RESULT))
  11. {
  12.   // Show the row number
  13.   $rowIndex++;
  14.   echo "Row $rowIndex";
  15.  
  16.   // Show each column in the row
  17.   foreach($row as $key => $value)
  18.   {
  19.     echo " - $key = $value";
  20.   }
  21. }
  22.  
Which would print out somehting like this:
Expand|Select|Wrap|Line Numbers
  1. Row 1
  2.  - UserID = 1
  3.  - UserName = User1
  4.  - UserPass = Randomness
  5.  - UserEmail = user1@domain.com
  6.  - UserPhone = 1234567
  7.  
This will obviously need to be written to match your data but you get my point.
Jun 27 '07 #5
pbmods
5,821 Expert 4TB
Changed thread title to better describe the problem.
Jun 27 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: frank | last post by:
I am in the process of writing a fairly large ASP.NET web application and I am about to implement log-ons, permissions etc. I have never used any security with ASP.NET before; only classic ASP. ...
6
by: WebMatrix | last post by:
Hello, Sorry for the repost, I haven’t got any response in aspnet.webservices group. We have a web service being used by several clients. It's SSL secured, uses Windows (Basic)...
27
by: Pete | last post by:
I'm doing exercise 8-2 from "Accelerated C++" where we're supposed to implement library algorithms, trying to minimize the number of iterator operations. I have two questions so far. First,...
0
by: SteMc | last post by:
Help! Having started VB for the first time not long ago I've only ever had to do very basic things to achieve what I want. Trying to deal with the IDocHostUIHandler interface thingy majic is...
8
by: michael sorens | last post by:
I have searched through the MSDN documentation but without success for this very common task: implementing Ctrl-C, Ctrl-V, and Ctrl-X for any of a number of TextBox controls on a form. Roughly it...
1
by: flopbucket | last post by:
Hi, For the learning experience, I am building a replacement for std::map. I built a templated red-black tree, etc., and all the basic stuff is working well. I implemented basic iterators and...
4
by: zacks | last post by:
Most applications whose purpose is to work with various types of files implement a "Most Recent Files" list, where the last, say, four files accessed by the application can quickly be re-opened by...
6
by: csharpula csharp | last post by:
Hello , I would like to build a tree structure in c# using the arraylist or hash table. what is the best way to implement it if I want to add children and to print my tree. Thank you! ***...
6
by: Jonathan Wood | last post by:
Although this will be a challenge at my level of ASP.NET knowledge, I'm thinking I should implement my own membership provider class. Looking over the methods I must implement, a number of...
8
by: nickooooola | last post by:
Hello to all I'm about to write a simulator for a microcontroller in python (why python? because I love it!!!) but I have a problem. The registry of this processor are all 8 bit long (and 10...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.