Jump to content

Stat count / database help (noob)


keskin

Recommended Posts

I have a web site I need to do, so I need help on finalizig it.

 

It's about this fishing sports club, and the members want to be able to put in their personal stats by themselves, not by me.

 

So, the page needs the login/register members part, which I never done before, and also, it needs a somekind of stat tracking.

 

ie

 

one member logs in, and inputs 5 fish

another one logs in, inputs 3

 

and on front page there is a ticker that shows current count, 8

 

and after two days, on another ticker it shows average 4 per day

 

So, any hel with this I would be very grateful

Link to comment
Share on other sites

This is an extremely broad request, bordering one 'please code everything for me from my 2 lines of specification'. Why not try some simple log in code and post it here and we'll help you.

 

One step at a time.

 

BTW google is your friend, there are lots of good tutorials out there for login stuff.

 

monk.e.boy

Link to comment
Share on other sites

Well, do the login bit first.

 

For the stats, you need a database, every time a member enters a fish, you also store the date and time. Then on the front page you count all the fish caught this week (as an example) and display this as an average.

 

Without some more data and an example equation I am a bit stuck.

 

Please post some examples:

 

  Jeff catches 77 Fish, each of 5lb on 12/12/2007, on the font page I want XXXXXX displayed.

 

monk.e.boy

Link to comment
Share on other sites

OK I'll do some search on login part of the story...

 

As for the stats, I really would like to keep it as basic as possible, because we all know that we can go infinite on statistical combinations...

 

So, I would basically break it down to this;

 

Let's say I got 3 fishermen registered.

 

There would be 3 fields.

 

1. - Location (of the individual fisherman)

2. - Fish category (shellfish, squid, octopus etc.)

3. - Fish count

 

On the front page, I would like to show mainly total amount of fish, regardless of other categories like location and category.

 

Also, it would be nice to have some variations on the front page like Daily Average and Top Fisherman of the Week and/or of the Month.

 

Also, it would be cool if I could make a table with listing which I can sort by criteria such as sorty by location, sorty by category, sort by fishermen...

 

I will try to make this page, it will take some effort but I think that it is possible...

 

Hope that I explained it good enough so I can get some quality help :)

 

Thanks

Link to comment
Share on other sites

 

There would be 3 fields.

 

1. - Location (of the individual fisherman)

 

Hook this up to google maps. Link in some fish adverts. Hook into a Fish picture database. Local fishing news. Local shops selling fishing gear. Local competitions. Editorials on how to fish. Christmas fishing present ideas.

 

Adverts = you're starting to make some money to fund the website.

 

Hey, this is starting to be a nice little project.

 

GET THE LOGIN PAGES FINISHED!!!  ;) ;) :D :D

 

monk.e.boy

Link to comment
Share on other sites

Login DONE! :D

 

Well, the test version only...

 

I really didn't do much but follow the steps of one guy on some website...

 

The login/out works, it has remember feature, and it works.

 

When I close IE, and then go to localhost page again, I stay logged in.

 

When I logout, I logout :D

 

While I'm figuring a way where to put this on my website, we could start on making that database...

 

Where should I start?

 

I work with xampp and have phpMyadmin of course...

 

;D

Link to comment
Share on other sites

I done the login part...

 

How to include that in my HTML page?

 

Where can I put the code, and is it possible to insert it in HTML with Dreamweavers "Insert PHP objects" menu?

 

My login script consist of database.php, login.php, logout.php, register.php and main.php.

 

So, how to set these files to apropriate html pages (or can I convert my HTML pages to php?)

Link to comment
Share on other sites

<html>
<head>
</head>
<body>
<?php
echo 'hello';
?>
</body>
</html>

 

Like that. So maybe dreamweaver will allow you to do this? I'm not sure.

 

Next is getting a connection to your database up and running. Are you using MySQL? Have you tested your login script on your server?

 

monk.e.boy

Link to comment
Share on other sites

Progress!  ;D

 

I succesfully made the login/logout script work. I even adjuted it so it looks just like my website theme, so it's fully implemendted, I guess...

 

The only thing that I need take care of is the status bar or whatever is it called, a line that will show "Welcome User, you are now logged in. Logut here" on the top of every page on my site.

 

Or that isn't neccessary?

 

The login script has a "remember me" feature and it works.

 

The phpMyadmin shows 16 users in "users" table of my database, so that's also working, since I've tried with that many logins :)

 

So, to put it briefly;

 

1. Can I put sort of breadcrumb bar on top of the site with "Login / you are logged in / Logout" feature?

 

2. After I put php parts in my website pages, the containter went to left, and now all the pages that contain scripts (login page, register page) are aligned to left...although they have the same exact code as the ones without php and those show centered both in IE and MF

 

Well, I hope I make some progress...

 

Hope I'll start that database soon :)

Link to comment
Share on other sites

Try to add the login/logout bread crumb your self, if you have any problems, post your code here.

 

You need to add a line similar to this:

 

<?php

if( $logged_in )
  echo '<a href="logout.php">log out</a>';
else
  echo 'Hello guest, <a href="login.php">log in</a>';

?>

 

monk.e.boy

 

Link to comment
Share on other sites

Done LOL :D

 

Now for the hard part - the database.

 

OK guys, where do I start.

 

I was thinking about this later, I need a each member page to make, with "stats" displayed etc...

 

Where should i begin?

Link to comment
Share on other sites

You need a table for each item you are thinking of saving data about.

 

So tables will be something like:

 

members (id,name,email,etc)

fish (id,name,fk_fish_type)

fish_type (id,type)

caught (fk_fish,fk_member,datetime,weight)

 

fk_ means a foreign key to a table. It links the tables together. So table caught links the weight and date to a member and to a fish. So JOINing these you get:

 

John,marlin,5kg,12-12-2007

 

I think fish type may be too much. I was thinking that you may need fresh water and sea fish. But ignore this if it is too much.

 

So you need to think of some simple tables like the above and create them in MySQL. Don't worry if you make mistakes, we all do. MySQL is very nice and will let you add/delete/change tables at any time.

 

Check out the database tutorials on this site. Keep asking questions  :)

 

monk.e.boy

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.