PHP and March Madness - Techist - Tech Forum

Go Back   Techist - Tech Forum > Computer Software > Programming
Click Here to Login
Closed Thread
 
Thread Tools Display Modes
 
Old 11-04-2003, 10:45 PM   #1 (permalink)
Newb Techie
 
Join Date: Nov 2003
Posts: 5
Send a message via AIM to myOSNT
Default PHP and March Madness

Here is what i want to do: make a website that allows users to create a march madness ncaa basketball braquet using a series of drop-down menus to select their teams. then i want them to be able to press submit, and store the information in a database. after that, i want to be able to have the user view their braquet at any time. i dont want a password protected thing, just enter your name and then select your picks for the winners. then submit (store to mysql database). then be able to type in the name to fetch the information. im not sure where to get started. and ideas?
__________________

__________________
myOSNT is offline  
Old 11-04-2003, 11:55 PM   #2 (permalink)
Monster Techie
 
Join Date: Jul 2003
Posts: 1,179
Send a message via AIM to Emily
Default

Do you know PHP? SQL?

If not, it's pretty easy to learn from www.php.net, especially if you already know another programming language.

Hope this helped.
__________________

__________________
www.upstark.com
Emily is offline  
Old 11-05-2003, 06:27 AM   #3 (permalink)
Newb Techie
 
Join Date: Oct 2002
Posts: 17
Send a message via ICQ to bleed_inc
Default

Yes you will need to know PHP & MYSQL.

Some good sites to get you started are:


www.phpfreak.com
http://php.resourceindex.com
www.easyphp.org

Or you can just by a php & mysql book.

PHP & MY by Larry Ullman is a good start.

Your webserver must also support PHP..
__________________
bleed_inc is offline  
Old 11-05-2003, 08:12 AM   #4 (permalink)
Newb Techie
 
Join Date: Nov 2003
Posts: 5
Send a message via AIM to myOSNT
Default

yes, i do know php, but im not sure how to get it to save the stuff into a database, then refresh it when it is requested
__________________
myOSNT is offline  
Old 11-05-2003, 10:23 AM   #5 (permalink)
Monster Techie
 
Join Date: Jul 2003
Posts: 1,179
Send a message via AIM to Emily
Default

The database stuff is SQL. It's pretty easy to learn... when I get home from school today I'll post a sample script so you can see what it looks like; I learned from looking at other people's scripts.
__________________
www.upstark.com
Emily is offline  
Old 11-05-2003, 03:34 PM   #6 (permalink)
Super Techie
 
Join Date: Oct 2003
Posts: 354
Default

Quote:
Originally posted by bleed_inc
Or you can just by a php & mysql book.

PHP & MY by Larry Ullman is a good start.

Good book.
__________________
<font face=\"arial\" color=\"#414D6A\" size=\"1\">PC SPECS:</font>
<font face=\"arial\" size=\"1\">
AMD Bartion 2500+ 1800Mhz
ASUS A7V8X-X
PC2100 256Mb DDRAM x 2
LG 52x24x52 CD
Seagate 80Gb 7200rpm 2Mb
ATI Radeon 9550 256Mb 8x
Intergrated PCI sound
17\" Samsung LCD 173s
</font>
Ken Masters is offline  
Old 11-05-2003, 07:01 PM   #7 (permalink)
Newb Techie
 
Join Date: Nov 2003
Posts: 5
Send a message via AIM to myOSNT
Default

ok, i have a book titled "PHP in easy steps." I just am still unsure how to do what i am planning. to get a better idea of what i want, check out http://openwar.net/bin/braquet.htm. i made it, but it does nothing. after they make their braquet, i want them to be able to type in their username and view it.
__________________
myOSNT is offline  
Old 11-05-2003, 08:30 PM   #8 (permalink)
Monster Techie
 
Join Date: Jul 2003
Posts: 1,179
Send a message via AIM to Emily
Default

Ok, here's a very simple beginners script for inserting data into a database (you obviously have to change the variables to reflect your username, password, db name, etc.)

****

<?php

// set variables to enter into db

$value1_var = "Lalala";
$value2_var = "Blahblah";
$value3_var = "Dumdedum";

// set vars for connecting to db

$host = "localhost";
$username = "username";
$password = "password";

$db = mysql_connect($host, $username, $password) or die("A connection to the database could not be established.");
mysql_select_db("my_database", $db);

$sql = "INSERT INTO `my_table` ( `value1` , `value2` , `value3` ) VALUES ('$value1_var', '$value2_var', '$value3_var') ";

mysql_query($sql, $db);

?>


******

(This is assuming you know how to set up and adminster your db. Um... do you?)

And by the way, I swear by the Larry Ullman book bleed_inc mentioned.
__________________
www.upstark.com
Emily is offline  
Old 11-05-2003, 09:11 PM   #9 (permalink)
Newb Techie
 
Join Date: Nov 2003
Posts: 5
Send a message via AIM to myOSNT
Default

i do know how to set up and administer databases. i just dont know how to save stuff to it from different users and how to then fetch and display the stuff
__________________
myOSNT is offline  
Old 11-08-2003, 01:01 PM   #10 (permalink)
Monster Techie
 
Join Date: Jul 2003
Posts: 1,179
Send a message via AIM to Emily
Default

Ok, well you would use the script above to save stuff to the database. And the same thing but with this script to retrieve the data:

$result = mysql_query("SELECT * from table");

while ($row = mysql_fetch_row($result)) {
$value1 = $row[0];
$value2 = $row[1];
$value3 = $row[3];
print ("$value1, $value2, $value3");
}

Good luck
__________________

__________________
www.upstark.com
Emily is offline  
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -5. The time now is 07:48 PM.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2018, vBulletin Solutions, Inc.