Old 18-02-2008, 13:39   #1 (permalink)
philmetz
Registered User
 
Join Date: Nov 2007
Posts: 72
Database?

Hi

i got a website but as i was creating it i found that i would have so many pages. Is there a possibilty to say have one real template and a database and depending on what you click on on the main page it will load the details from the database to website?

and can anyone help

thanks
  Reply With Quote
Old 18-02-2008, 13:54   #2 (permalink)
datahound
Spare Parts
 
datahound's Avatar
 
Join Date: Jan 2005
Location: Bracknell Forest
Posts: 4,931
Like this?

Create a page outputsql.php. Set it up to output from your database but use this code to create your sql query code.

<?php
if($search){$sql = "SELECT * from database where col1 LIKE '$search'";}
else {$sql = "SELECT * from database";}
?>

So the default is all comes out of the db.

Now set up a page orange.php. Or any other call you want to make on the db. Then the first line of orange.php would be

<?php
$search="orange";
include("outputsql.php");
?>
__________________
  Reply With Quote
Old 18-02-2008, 13:54   #3 (permalink)
Tom_E
Whippet Botherer™
 
Tom_E's Avatar
 
Join Date: Jan 2007
Location: Kent, England
Posts: 1,532
Another day, another problem eh Phil?
__________________
  Reply With Quote
Old 18-02-2008, 14:41   #4 (permalink)
philmetz
Registered User
 
Join Date: Nov 2007
Posts: 72
hahah ya Tom, trying to create this webpage but not an expert in html and database etc, just basics, like real basics
  Reply With Quote
Old 18-02-2008, 14:55   #5 (permalink)
philmetz
Registered User
 
Join Date: Nov 2007
Posts: 72
w if ill be able to do what data hound said, i was hoping it could be simple like say if i click on a cartain link on my page it will load the details related to that link from say a spreadsheet or something
  Reply With Quote
Old 18-02-2008, 15:05   #6 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,358
Forget databases for now. You can use Google's site search thing.

Take one step at a time. Learn HTML and CSS. Then some JavaScript. Then start looking at programming and databases.

I didn't learn a lick of PHP or MySQL until I had been doing HTML and CSS for 2 years.
  Reply With Quote
Old 18-02-2008, 15:15   #7 (permalink)
philmetz
Registered User
 
Join Date: Nov 2007
Posts: 72
hmmm, cos right now let me show you how my site will be like.
there is a home page:
index.html
then there are 26 pages, from a-z on the hom page
now in each of those letter there are a number of other pages as well

so i thought it would be easier to use a database and say have one main page and it pulls the data from somewhere
  Reply With Quote
Old 18-02-2008, 16:26   #8 (permalink)
Tom_E
Whippet Botherer™
 
Tom_E's Avatar
 
Join Date: Jan 2007
Location: Kent, England
Posts: 1,532
I'm not being rude Phil, but you didn't know the difference between Photoshop and Flash the other day, you have no chance of building a database-driven site.
__________________
  Reply With Quote
Old 18-02-2008, 16:35   #9 (permalink)
philmetz
Registered User
 
Join Date: Nov 2007
Posts: 72
i actually do, i just miss placed my words, i was thinking there was a function for flash in photoshop like there is in this other program i once used
  Reply With Quote
Old 20-02-2008, 03:20   #10 (permalink)
armored
Registered User
 
Join Date: Jun 2007
Posts: 1
It seems like you might be better off looking into a CMS for this. This will save you the burden of working with a database directly. One good starting point might be Joomla!
  Reply With Quote
Old 28-03-2008, 04:25   #11 (permalink)
philmetz
Registered User
 
Join Date: Nov 2007
Posts: 72
hmmm is it simple to use? how exactly does it work the joomla?
thanks

I have a website right now for football team anthems. Now right now i have to create and edit a page for every team and as i add more teams it will take a lot of work, so thought there would be an easy way where i can have a template with variables and they all get replaced with the correct team etc.

website is here: fervor.110mb.com

thanks
  Reply With Quote
Old 30-03-2008, 03:30   #12 (permalink)
philmetz
Registered User
 
Join Date: Nov 2007
Posts: 72
anyone know?
  Reply With Quote
Old 30-03-2008, 07:16   #13 (permalink)
iblastoff
gotsa a malanga!
 
iblastoff's Avatar
 
Join Date: Apr 2006
Location: ottawa, canada
Posts: 489
know what? if joomla is good/easy? go try it yourself? but in short: no.
__________________
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8