|
-
Oct 10th, 2002, 08:53 PM
#1
Thread Starter
Hyperactive Member
Database Page?
i need some help, i have no idea on how to do this. want to know how can i make my page have a teplate and have it use mysql to output data? if you could please help i would really like that thanks!
-
Oct 11th, 2002, 03:00 PM
#2
Stuck in the 80s
What do you mean, exactly? Can you provide some psuedo-code (sp?) like a basic run down of what you want to do? Then maybe I can fill in the coding blanks for you.
-
Oct 11th, 2002, 05:03 PM
#3
Thread Starter
Hyperactive Member
well i have never worked with templates before so i dont really know what to start with.
how its going to work is i want to have a php page that prosses every thing and connects to my database. then i have the templates that show the layout of the page. and then the data comes out to the template to make my page. im also wanting to put in a admin part so the admin can chagne the data.
now i hope that explans it.
-
Oct 15th, 2002, 02:09 PM
#4
Frenzied Member
so you make the page how you want and name it header.php and footer.php
then do your code and just include the header adn footer in the correct spot with
include_once("header.php");
code goes in here
include_once("footer.php");
if you want somebody to write this for you then I would suggest you red very heavily or download a pre-existing one from www.hotscripts.com
writing this will take weeks if not months and I doubt anybody will do it for you.
-
Oct 16th, 2002, 08:21 PM
#5
Thread Starter
Hyperactive Member
im just talking a simple thing that will read table from a database. i can expand from that.
-
Oct 16th, 2002, 09:28 PM
#6
Stuck in the 80s
Originally posted by Muk108
im just talking a simple thing that will read table from a database. i can expand from that.
Then look up database functions in the manual www.php.net
Maybe phpman has a clue, but I have no idea what you're asking. You're too broad in what you want.
phpman gave you the basics of having a template. make a header and a footer file to include, throw the code to create the page in the middle.
if that doesn't help, then you need to be more specific.
-
Oct 17th, 2002, 09:08 AM
#7
Frenzied Member
Originally posted by Muk108
im just talking a simple thing that will read table from a database. i can expand from that.
ahhh simple, ok here it goes
select * from table
no can you expand on that?
no didn't think so.
$query = mysql_query("select * from table_name");
while ($row=mysql_fetch_array($query)){
echo $row['row_name'];
}
there you go. that will read everythign from a table. no I didn't mention you will need a connection to a database before you do this.
you talk about a template then you just want something simple to read form a DB. which one is it??
-
Oct 17th, 2002, 02:30 PM
#8
Thread Starter
Hyperactive Member
it seems like your just trying to be rude to me. i ment that i wanted a basic idea of how to make a php thing that will read the data and the template will use the data.
-
Oct 17th, 2002, 02:48 PM
#9
Stuck in the 80s
Originally posted by Muk108
it seems like your just trying to be rude to me. i ment that i wanted a basic idea of how to make a php thing that will read the data and the template will use the data.
I'm not trying to be rude at all. I just don't understand what you mean.
Can you give example data and an example template so that maybe we can help you write the code to put it together?
You're just repeating the same things that aren't making sense to me. Read data into a template can mean a lot of things. You need to describe it more, other wise we're going to waste time to come up with some code that does what you don't want it to do.
-
Oct 17th, 2002, 03:15 PM
#10
Frenzied Member
Originally posted by Muk108
it seems like your just trying to be rude to me. i ment that i wanted a basic idea of how to make a php thing that will read the data and the template will use the data.
if you are talking to me then I was trying to be, but listen to what hobo said.
you want to use a template that gets info from a DB, well I should you twice oon how to do it and if you don't understand then I suggest you read up on it some more and figure out how php really works then you will understand.
basic template-----------
<?
include_once("header.php");
$query = mysql_query("select * from table_name");
while ($row=mysql_fetch_array($query)){
echo $row['row_name'];
}
include_once("footer.php");
?>
------------------------------
there you go, a template that reads from a DB. now in the header footer pages you have the necessary html to start the page and whatever you want in them.
-
Oct 17th, 2002, 03:45 PM
#11
Thread Starter
Hyperactive Member
ok thank you for your help thats all i needed to know ill expand off that.
-
Oct 17th, 2002, 03:50 PM
#12
Frenzied Member
geez that is what I told you in the 4th post in this thread.
-
Oct 17th, 2002, 09:09 PM
#13
Stuck in the 80s
Originally posted by Muk108
ok thank you for your help thats all i needed to know ill expand off that.
I am going to be rude, now.
You should really punctuate your sentences.
It helps.
Reall, it does.
-
Oct 17th, 2002, 09:15 PM
#14
Thread Starter
Hyperactive Member
Well, im sorry if i upset you with not punctuating my sentences.
-
Oct 17th, 2002, 09:22 PM
#15
Stuck in the 80s
Originally posted by Muk108
Well, im sorry if i upset you with not punctuating my sentences.
yeah its really hard to understand i think you should add it it will make it better because sometimes it makes it really hard to follow i mean you learn it in school for so many years why not use it it just seems natural otherwise you wont be understood easily and thus less people will want to help you i think the point of posting is to get help you should want people to help you should want to use punction
you know?
-
Oct 18th, 2002, 02:28 PM
#16
Thread Starter
Hyperactive Member
I have never really understood english and how to use it in a sentance. So this makes it harder for me to follow the rules and what not. But i really like your guys help thanks!
-
Oct 18th, 2002, 10:19 PM
#17
Stuck in the 80s
Sorry. If I knew English wasn't your first language, I wouldn't have been an ass.
Some people don't have an excuse, though. I have too many little things that set me off.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|