Flash Gordon
07-10-2005, 10:03 PM
I was trying to help someone on here build an flash poll, but I'm stuck on how to retrieve the data. Here is what I have so far:
<?php
$reviews = $_GET['reviews'];
$transcriptions = $_GET['transcriptions'];
$interviews = $_GET['interviews'];
$IP = $_SERVER['REMOTE_ADDR'];
$user = "****";
$password = "*****";
$database = "*****";
$table = "results";
//--------------connenct to database
mysql_connect(localhost,$user,$password) or die("Could not connect");
mysql_select_db($database) or die ("Could not select the database");
//--------------insert the data into datbase
$query = "INSERT INTO " . $table . " VALUES('', '$reviews', '$transcriptions', '$interviews', '$IP')";
mysql_query($query);
//-------------get data from database
$reviews = "SELECT `reviews` FROM `results`";
$transcriptions = "SELCET 'transcriptions' FROM 'results'";
$interviews = "SELECT 'interviews' FROM 'results'";
$reviewsResults = mysql_query($reviews);
$transcriptionsResults = mysql_query($transcriptions);
$interviewsResults = mysql_query($interviews);
//-------------display results of data
//mysql_fetch_row()
//mysql_fetch_array()
//mysql_fetch_assoc()
//mysql_fetch_object()
//mysql_result()
Right now there are contents in $reviews, $transcripts, and $interviews but I don't know how to get the data to make it manageable. I'm guessing I need to use one of the last several functions I listed in the php code above, but I'm stuck. Any help? I'd like to just put the answers in a normal array.
Each variable ($reviews, $transcripts, and $interviews) has two options: 'yes' or 'no'. I eventually want to seperate them also, but that shouldn' be a problem once I get the data to where I can work with it.
Thanks
FG
--------------------------
The info is not need, just a little somthing extra incase I didn't explain it well
I'm trying to get the contents of the database. which looks like this
id--reviews--transcriptions--interviews--IP (used to see if they have already voted)
0 yes yes no xxx.xxx.
1 no no yes xx.xx.
2 yes no yes xx.xx.
etc.................
<?php
$reviews = $_GET['reviews'];
$transcriptions = $_GET['transcriptions'];
$interviews = $_GET['interviews'];
$IP = $_SERVER['REMOTE_ADDR'];
$user = "****";
$password = "*****";
$database = "*****";
$table = "results";
//--------------connenct to database
mysql_connect(localhost,$user,$password) or die("Could not connect");
mysql_select_db($database) or die ("Could not select the database");
//--------------insert the data into datbase
$query = "INSERT INTO " . $table . " VALUES('', '$reviews', '$transcriptions', '$interviews', '$IP')";
mysql_query($query);
//-------------get data from database
$reviews = "SELECT `reviews` FROM `results`";
$transcriptions = "SELCET 'transcriptions' FROM 'results'";
$interviews = "SELECT 'interviews' FROM 'results'";
$reviewsResults = mysql_query($reviews);
$transcriptionsResults = mysql_query($transcriptions);
$interviewsResults = mysql_query($interviews);
//-------------display results of data
//mysql_fetch_row()
//mysql_fetch_array()
//mysql_fetch_assoc()
//mysql_fetch_object()
//mysql_result()
Right now there are contents in $reviews, $transcripts, and $interviews but I don't know how to get the data to make it manageable. I'm guessing I need to use one of the last several functions I listed in the php code above, but I'm stuck. Any help? I'd like to just put the answers in a normal array.
Each variable ($reviews, $transcripts, and $interviews) has two options: 'yes' or 'no'. I eventually want to seperate them also, but that shouldn' be a problem once I get the data to where I can work with it.
Thanks
FG
--------------------------
The info is not need, just a little somthing extra incase I didn't explain it well
I'm trying to get the contents of the database. which looks like this
id--reviews--transcriptions--interviews--IP (used to see if they have already voted)
0 yes yes no xxx.xxx.
1 no no yes xx.xx.
2 yes no yes xx.xx.
etc.................