PHP and March Madness

Status
Not open for further replies.

myOSNT

Beta member
Messages
5
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?
 
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. :)
 
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
 
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.
 
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.
 
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.
 
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
 
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 :)
 
Status
Not open for further replies.
Back
Top Bottom