SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    SitePoint Addict whofarted's Avatar
    Join Date
    Aug 2001
    Location
    lost, If you find me please return me to St.Louis
    Posts
    396
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Making a profile page / MySQL question

    I'm getting ready to make my first php page from scratch.

    Problems are expected to be pleanty as I've NEVER delt with a database before, but i'm gonna give it a shot.

    I want to be able to display a lot of information, but I don't know where to even start with the awards part. (It's for a DF3 Clan.)

    Here's my questions:
    1.) How would I make awards appear if they have them? And since you can win many awards more than once it would have to show the number of times this award was won. How would I do that?

    2.) What do I put in the database to point to where the image file is?

    Like I said I'm basically MySQL illiterate but I'm learning.

    To see an example of what the page needs & will look like you can go here.

    I've got a little bit of php down now thanks to php-nuke & playing with it.

    TIA!
    p.s. I've read the "jokes" lesson already & am going to check it out again but it doesn't answer all my questions. Please help anyway if you can.
    You smell something?

  2. #2
    SitePoint Addict whofarted's Avatar
    Join Date
    Aug 2001
    Location
    lost, If you find me please return me to St.Louis
    Posts
    396
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just thought of another question

    Using php-nuke, how would I put a php file into another directory to keep things organized.

    example:
    instead of locating it here: h**p://www.i3team.f2s.com/profile.php

    how would I put it here: h**p://www.i3team.f2s.com/members/profile.php

    I tried to make a subdirectory called members & putting it in there but it gives me errors. Anyone know why?
    You smell something?

  3. #3
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    example:
    instead of locating it here: h**p://www.i3team.f2s.com/profile.php

    how would I put it here: h**p://www.i3team.f2s.com/members/profile.php

    I tried to make a subdirectory called members & putting it in there but it gives me errors. Anyone know why?
    What is the error? Is it the same header error, as is displaying on your site? If yes, it is in the code, and you are specifying a template or some other header information after you have called or written something else, which you are not allowed to do. All header info MUST go first.

    1.) How would I make awards appear if they have them? And since you can win many awards more than once it would have to show the number of times this award was won. How would I do that?
    Thats a little bit trickier. One option is, because presumably the same player can receive the same award more than once, as well as different awards, is to separate the awards from the player table in your database and then relate to it. I think you said you read Kyanks tutorial -- have a look at the bit where he talks about relational databases, i think he uses the example of the same submitter having different email addresses or something (or is it subcatting the jokes style, anywho..).

    This would be easier, because when you update the table you would only need to do an insert statement rather than an update statement.

    so you might have two tables that look like this:

    player {
    id, firstname, lastname, playerid }

    awards {

    id, awardtype, awardid }

    that way you could insert into awards everytime someone gets a new award, and just reference it to your player table. You could also add to it to include the url of the image that would need to be displayed, or instead, I would have a separate table (if yuo have LOTS of awards), which are referenced to your awards table that give the html code of the image that needs to be displayed.

    To count the no. of times someone has received an award, do the select statement that gets the info from the table and then use mysql_num_rows to count it.
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  4. #4
    SitePoint Addict whofarted's Avatar
    Join Date
    Aug 2001
    Location
    lost, If you find me please return me to St.Louis
    Posts
    396
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    here you can see for yourself:

    http://www.i3team.f2s.com/profile.php?playername=Smokey <= works fine

    http://www.i3team.f2s.com/members/pr...yername=Smokey <= Same file dif dir. Doesn't work. theres the error.

    heres the the code with the middle edited out. (edited out the html section of the page.)

    PHP Code:
    <?php


    if(!isset($mainfile)) { include("mainfile.php"); }
    include(
    "header.php");

    $result mysql_query("SELECT playerrealname,location,playerjob,playercharactor,playerquote,playerstatus,playerweapons,playerpicture,playername FROM player_profile where playername='$playername'");if (!$result) { echo("<P>Error performing query: " mysql_error() . "</P>"); exit();}
    list(
    $playerrealname,$location,$playerjob,$playercharactor,$playerquote,$playerstatus,$playerweapons,$playerpicture,) = mysql_fetch_row($result);
    ?>
    ### this is edited out html ###

    <?php
    include("footer.php");
    ?>
    I tried to edit the includes to be to the files like this:

    include("../header.php");

    I tried this with all the includes mainfile, header, & footer. None worked.

    If it helps my CMS is php-nuke 5.2
    You smell something?

  5. #5
    SitePoint Addict whofarted's Avatar
    Join Date
    Aug 2001
    Location
    lost, If you find me please return me to St.Louis
    Posts
    396
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Guess no help

    I'll ask around in php-nuker forums I guess.
    You smell something?

  6. #6
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    wtf is open_basedir in effect anyway?
    I'm making an image upload script, and im getting that a lot.
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  7. #7
    Victory shall be mine tubedogg's Avatar
    Join Date
    Mar 2001
    Location
    Medina, OH
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    open_basedir is a way of controlling your access when using PHP scripts to a certain set of directories. It's most often seen with Plesk, though it can be manually set by admins.

    Basically it's a pain in the *** because the admin has to be smart enough to also set the temporary upload directory to within your allowed directories or else you don't own the file that was uploaded and you can't do anything with it. Most don't bother to do this.
    Kevin

  8. #8
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    heh, mine did, and has SAFE MODE on.
    P.I.T.A.
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  9. #9
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Defender1

    P.I.T.A.
    Huh?
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky

  10. #10
    SitePoint Wizard Defender1's Avatar
    Join Date
    Apr 2001
    Location
    My Computer
    Posts
    2,808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Pain In The @$$
    Defender's Designs
    I'm Getting Married!

    Not-so-patiently awaiting Harry Potter Book 7 *sigh*

  11. #11
    We like music. weirdbeardmt's Avatar
    Join Date
    May 2001
    Location
    Channel Islands Girth: Footlong
    Posts
    5,882
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    got ya
    I swear to drunk I'm not God.
    Matt's debating is not a crime
    Hint: Don't buy a stupid dwarf Clicky


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •