soccerrprp1 Posted October 22, 2010 Share Posted October 22, 2010 Hi all, I've created a data-entry HTML page that posts to update.php. I am using mysql to store the data entered. When I enter data and hit "update database" button, the php file pops up and correctly shows the data entered, but the update.php file does not show that same data on another computer. I have checked the mysql database and it clearly shows that it the new data has been stored. Why isn't the data showing up on any other computer? I can provide codes as needed. Thanks. Richard Quote Link to comment Share on other sites More sharing options...
naike Posted October 22, 2010 Share Posted October 22, 2010 Shift-reload the page. Also next time post your code as well.. Quote Link to comment Share on other sites More sharing options...
turkman Posted October 22, 2010 Share Posted October 22, 2010 php will not automaticly update a remote webpage without being refreshed. It will show the file as it was when you last requested it, until you request it again (refresh) only then will it show the updated information. What you are thinking would require ajax. Basically you need to create a settimeout on each page to check for new databsse info using ajax, however i think this is beyond your current ability. Quote Link to comment Share on other sites More sharing options...
soccerrprp1 Posted October 22, 2010 Author Share Posted October 22, 2010 hey guys, thanks refreshing page does not update data. ajax is my next step and pretty certain i'll be able to get what i need from it. i have my code below. here is my code for php: <?php # BEGINNING OF PHP! $gsteam= $_POST["gsteam"]; $gsteam1= $_POST["gsteam1"]; $gsstatus= $_POST["gsstatus"]; $gsscore= $_POST["gsscore"]; $gsscore1= $_POST["gsscore1"]; $bteam= $_POST["bteam"]; $bteam1= $_POST["bteam1"]; $bstatus= $_POST["bstatus"]; $bscore= $_POST["bscore"]; $bscore1= $_POST["bscore1"]; $s1team= $_POST["s1team"]; $s1team1= $_POST["s1team1"]; $s1status= $_POST["s1status"]; $s1score= $_POST["s1score"]; $s1score1= $_POST["s1score1"]; $s2team= $_POST["s2team"]; $s2team1= $_POST["s2team1"]; $s2status= $_POST["s2status"]; $s2score= $_POST["s2score"]; $s2score1= $_POST["s2score1"]; $gteam= $_POST["gteam"]; $gteam1= $_POST["gteam1"]; $gstatus= $_POST["gstatus"]; $gscore= $_POST["gscore"]; $gscore1= $_POST["gscore1"]; $username = ""hostname"; $password = "username"; $hostname = "localhost"; //connection to the database $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL" .mysql_error()); echo "Connected to MySQL<br>"; //select a database to work with $selected = mysql_select_db("littleti_droid",$dbhandle) or die("Could not select examples" .mysql_error()); //insert data from php web page $query="INSERT INTO stats (gsteam, gsteam1, gsstatus, gsscore, gsscore1, bteam, bteam1, bstatus, bscore, bscore1, s1team, s1team1, s1status, s1score, s1score1, s2team, s2team1, s2status, s2score, s2score1, gteam, gteam1, gstatus, gscore, gscore1) VALUES ('".$gsteam."','".$gsteam1."','".$gsstatus."','".$gsscore."','".$gsscore1."','".$bteam."','".$bteam1."','".$bstatus."','".$bscore."','".$bscore1."','".$s1team."','".$s1team1."','".$s1status."','".$s1score."','".$s1score1."','".$s2team."','".$s2team1."','".$s2status."','".$s2score."','".$s2score1."','".$gteam."','".$gteam1."','".$gstatus."','".$gscore."','".$gscore1."')"; $result = mysql_query($query) or die(mysql_error()); //fetch tha data from the database echo "[V]Team: " .$gsteam." ".$gsscore." Status: ".$gsstatus. "<br>";// input from web based echo "[H]Team: " .$gsteam1." ".$gsscore1."<br><br>";// input from web based echo "[V]Team: " .$bteam." ".$bscore." Status: ".$bstatus. "<br>";// input from web based echo "[H]Team: " .$bteam1." ".$bscore1."<br><br>";// input from web based echo "[V]Team: " .$s1team." ".$s1score." Status: ".$s1status. "<br>";// input from web based echo "[H]Team: " .$s1team1." ".$s1score1."<br><br>";// input from web based echo "[V]Team: " .$s2team." ".$s2score." Status: ".$s2status. "<br>";// input from web based echo "[H]Team: " .$s2team1." ".$s2score1."<br><br>";// input from web based echo "[V]Team: " .$gteam." ".$gscore." Status: ".$gstatus. "<br>";// input from web based echo "[H]Team: " .$gteam1." ".$gscore1."<br><br>";// input from web based //close the connection mysql_close($dbhandle); ?> here is my data entry code: <body> <form method="post" action="update.php"> <!--Gloria H. Snyder Stadium --> <b>Gloria H. Snyder Stadium</b> <br/> V: <input type="text" name="gsteam" size="30" /> <input type="text" name="gsscore" size="2" /> Status: <input type="text" name="gsstatus" size="10" /> <br/> H: <input type="text" name="gsteam1" size="30" /> <input type="text" name="gsscore1" size="2" /> <input type="submit" value="Update Database" /> </form> <form method="post" action="update.php"> <!--Baseball Stadium --> <b>Baseball Stadium</b> <br/> V: <input type="text" name="bteam" size="30" /> <input type="text" name="bscore" size="2" /> Status: <input type="text" name="bstatus" size="10" /> <br/> H: <input type="text" name="bteam1" size="30" /> <input type="text" name="bscore1" size="2" /> <input type="submit" value="Update Database" /> </form> <form method="post" action="update.php"> <!--Softball 1 --> <b>Softball Field I</b> <br/> V: <input type="text" name="s1team" size="30" /> <input type="text" name="s1score" size="2" /> Status: <input type="text" name="s1status" size="10" /> <br/> H: <input type="text" name="s1team1" size="30" /> <input type="text" name="s1score1" size="2" /> <input type="submit" value="Update Database" /> </form> <form method="post" action="update.php"> <!--Softball 2 --> <b>Softball Field II</b> <br/> V: <input type="text" name="s2team" size="30" /> <input type="text" name="s2score" size="2" /> Status: <input type="text" name="s2status" size="10" /> <br/> H: <input type="text" name="s2team1" size="30" /> <input type="text" name="s2score1" size="2" /> <input type="submit" value="Update Database" /> </form> <form method="post" action="update.php"> <!--Gymnasium --> <b>Gymnasium</b> <br/> V: <input type="text" name="gteam" size="30" /> <input type="text" name="gscore" size="2" /> Status: <input type="text" name="gstatus" size="10" /> <br/> H: <input type="text" name="gteam1" size="30" /> <input type="text" name="gscore1" size="2" /> <input type="submit" value="Update Database" /> </form> </body> MOD EDIT: . . . tags added. ~P2k Quote Link to comment Share on other sites More sharing options...
naike Posted October 22, 2010 Share Posted October 22, 2010 hey guys, thanks refreshing page does not update data. ajax is my next step and pretty certain i'll be able to get what i need from it. i have my code below. here is my code for php: <?php # BEGINNING OF PHP! $gsteam= $_POST["gsteam"]; $gsteam1= $_POST["gsteam1"]; $gsstatus= $_POST["gsstatus"]; $gsscore= $_POST["gsscore"]; $gsscore1= $_POST["gsscore1"]; $bteam= $_POST["bteam"]; $bteam1= $_POST["bteam1"]; $bstatus= $_POST["bstatus"]; $bscore= $_POST["bscore"]; $bscore1= $_POST["bscore1"]; $s1team= $_POST["s1team"]; $s1team1= $_POST["s1team1"]; $s1status= $_POST["s1status"]; $s1score= $_POST["s1score"]; $s1score1= $_POST["s1score1"]; $s2team= $_POST["s2team"]; $s2team1= $_POST["s2team1"]; $s2status= $_POST["s2status"]; $s2score= $_POST["s2score"]; $s2score1= $_POST["s2score1"]; $gteam= $_POST["gteam"]; $gteam1= $_POST["gteam1"]; $gstatus= $_POST["gstatus"]; $gscore= $_POST["gscore"]; $gscore1= $_POST["gscore1"]; $username = ""hostname"; $password = "username"; $hostname = "localhost"; //connection to the database $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL" .mysql_error()); echo "Connected to MySQL<br>"; //select a database to work with $selected = mysql_select_db("littleti_droid",$dbhandle) or die("Could not select examples" .mysql_error()); //insert data from php web page $query="INSERT INTO stats (gsteam, gsteam1, gsstatus, gsscore, gsscore1, bteam, bteam1, bstatus, bscore, bscore1, s1team, s1team1, s1status, s1score, s1score1, s2team, s2team1, s2status, s2score, s2score1, gteam, gteam1, gstatus, gscore, gscore1) VALUES ('".$gsteam."','".$gsteam1."','".$gsstatus."','".$gsscore."','".$gsscore1."','".$bteam."','".$bteam1."','".$bstatus."','".$bscore."','".$bscore1."','".$s1team."','".$s1team1."','".$s1status."','".$s1score."','".$s1score1."','".$s2team."','".$s2team1."','".$s2status."','".$s2score."','".$s2score1."','".$gteam."','".$gteam1."','".$gstatus."','".$gscore."','".$gscore1."')"; $result = mysql_query($query) or die(mysql_error()); //fetch tha data from the database echo "[V]Team: " .$gsteam." ".$gsscore." Status: ".$gsstatus. "<br>";// input from web based echo "[H]Team: " .$gsteam1." ".$gsscore1."<br><br>";// input from web based echo "[V]Team: " .$bteam." ".$bscore." Status: ".$bstatus. "<br>";// input from web based echo "[H]Team: " .$bteam1." ".$bscore1."<br><br>";// input from web based echo "[V]Team: " .$s1team." ".$s1score." Status: ".$s1status. "<br>";// input from web based echo "[H]Team: " .$s1team1." ".$s1score1."<br><br>";// input from web based echo "[V]Team: " .$s2team." ".$s2score." Status: ".$s2status. "<br>";// input from web based echo "[H]Team: " .$s2team1." ".$s2score1."<br><br>";// input from web based echo "[V]Team: " .$gteam." ".$gscore." Status: ".$gstatus. "<br>";// input from web based echo "[H]Team: " .$gteam1." ".$gscore1."<br><br>";// input from web based //close the connection mysql_close($dbhandle); ?> here is my data entry code: <body> <form method="post" action="update.php"> <!--Gloria H. Snyder Stadium --> <b>Gloria H. Snyder Stadium</b> <br/> V: <input type="text" name="gsteam" size="30" /> <input type="text" name="gsscore" size="2" /> Status: <input type="text" name="gsstatus" size="10" /> <br/> H: <input type="text" name="gsteam1" size="30" /> <input type="text" name="gsscore1" size="2" /> <input type="submit" value="Update Database" /> </form> <form method="post" action="update.php"> <!--Baseball Stadium --> <b>Baseball Stadium</b> <br/> V: <input type="text" name="bteam" size="30" /> <input type="text" name="bscore" size="2" /> Status: <input type="text" name="bstatus" size="10" /> <br/> H: <input type="text" name="bteam1" size="30" /> <input type="text" name="bscore1" size="2" /> <input type="submit" value="Update Database" /> </form> <form method="post" action="update.php"> <!--Softball 1 --> <b>Softball Field I</b> <br/> V: <input type="text" name="s1team" size="30" /> <input type="text" name="s1score" size="2" /> Status: <input type="text" name="s1status" size="10" /> <br/> H: <input type="text" name="s1team1" size="30" /> <input type="text" name="s1score1" size="2" /> <input type="submit" value="Update Database" /> </form> <form method="post" action="update.php"> <!--Softball 2 --> <b>Softball Field II</b> <br/> V: <input type="text" name="s2team" size="30" /> <input type="text" name="s2score" size="2" /> Status: <input type="text" name="s2status" size="10" /> <br/> H: <input type="text" name="s2team1" size="30" /> <input type="text" name="s2score1" size="2" /> <input type="submit" value="Update Database" /> </form> <form method="post" action="update.php"> <!--Gymnasium --> <b>Gymnasium</b> <br/> V: <input type="text" name="gteam" size="30" /> <input type="text" name="gscore" size="2" /> Status: <input type="text" name="gstatus" size="10" /> <br/> H: <input type="text" name="gteam1" size="30" /> <input type="text" name="gscore1" size="2" /> <input type="submit" value="Update Database" /> </form> </body> Did you try shift-clicking the reload button? Quote Link to comment Share on other sites More sharing options...
soccerrprp1 Posted October 22, 2010 Author Share Posted October 22, 2010 yes. reload does not update pages. Quote Link to comment Share on other sites More sharing options...
soccerrprp1 Posted October 23, 2010 Author Share Posted October 23, 2010 In addition to reloading/refreshing not doing a thing, a second or third, etc. tab of the same update.php page also doesn't show data (remains blank). Quote Link to comment Share on other sites More sharing options...
soccerrprp1 Posted October 28, 2010 Author Share Posted October 28, 2010 Any help on this? No one has ever had an issue of the data not updating? Could it be a mysql issue? Please... Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted October 28, 2010 Share Posted October 28, 2010 You have an extraneous quote here. Remove it and try it again. Let us know what happens, including any errors. $username = ""hostname"; Quote Link to comment Share on other sites More sharing options...
soccerrprp1 Posted October 28, 2010 Author Share Posted October 28, 2010 Thanks for the reply, but the hostname, password, host have all been set to their respective values so that the database can be accessed. So, how is hostname extraneous? Isn't it needed to access the db? The original code at top is misleading because the actual php file has the values. I can clearly access the db and the php returns updated with new data, but why it doesn't update other instances of the php file is beyond me. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted October 28, 2010 Share Posted October 28, 2010 I said 'extraneous quote', not 'extraneous value'. There are two double-quotes in a row, and they're cratering things. Quote Link to comment Share on other sites More sharing options...
Andy-H Posted October 28, 2010 Share Posted October 28, 2010 I only see an insert query, if you wish to display data to users that didn't post the data you must select it from the database using a select query, then feth the data using a mysql_fetch function (such as mysql_fetch_row then display the fetched data accordingly. Once the page is refreshed, unless the browser is re-posting the data to php (probably the case), the values will disappear to the poster aswell as they haven't been posted... Quote Link to comment Share on other sites More sharing options...
soccerrprp1 Posted October 28, 2010 Author Share Posted October 28, 2010 ah, got you. sorry. in the actual php file, that is not an issue. <?php # BEGINNING OF PHP! $gsteam= $_POST["gsteam"]; $gsteam1= $_POST["gsteam1"]; $gsstatus= $_POST["gsstatus"]; $gsscore= $_POST["gsscore"]; $gsscore1= $_POST["gsscore1"]; $bteam= $_POST["bteam"]; $bteam1= $_POST["bteam1"]; $bstatus= $_POST["bstatus"]; $bscore= $_POST["bscore"]; $bscore1= $_POST["bscore1"]; $s1team= $_POST["s1team"]; $s1team1= $_POST["s1team1"]; $s1status= $_POST["s1status"]; $s1score= $_POST["s1score"]; $s1score1= $_POST["s1score1"]; $s2team= $_POST["s2team"]; $s2team1= $_POST["s2team1"]; $s2status= $_POST["s2status"]; $s2score= $_POST["s2score"]; $s2score1= $_POST["s2score1"]; $gteam= $_POST["gteam"]; $gteam1= $_POST["gteam1"]; $gstatus= $_POST["gstatus"]; $gscore= $_POST["gscore"]; $gscore1= $_POST["gscore1"]; $username = "something"; $password = "something"; $hostname = "localhost"; //connection to the database $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL" .mysql_error()); echo "Connected to MySQL<br>"; //select a database to work with $selected = mysql_select_db("littleti_droid",$dbhandle) or die("Could not select examples" .mysql_error()); //insert data from php web page $query="INSERT INTO stats (gsteam, gsteam1, gsstatus, gsscore, gsscore1, bteam, bteam1, bstatus, bscore, bscore1, s1team, s1team1, s1status, s1score, s1score1, s2team, s2team1, s2status, s2score, s2score1, gteam, gteam1, gstatus, gscore, gscore1) VALUES ('".$gsteam."','".$gsteam1."','".$gsstatus."','".$gsscore."','".$gsscore1."','".$bteam."','".$bteam1."','".$bstatus."','".$bscore."','".$bscore1."','".$s1team."','".$s1team1."','".$s1status."','".$s1score."','".$s1score1."','".$s2team."','".$s2team1."','".$s2status."','".$s2score."','".$s2score1."','".$gteam."','".$gteam1."','".$gstatus."','".$gscore."','".$gscore1."')"; $result = mysql_query($query) or die(mysql_error()); //fetch tha data from the database echo "[V]Team: " .$gsteam." ".$gsscore." Status: ".$gsstatus. "<br>";// input from web based echo "[H]Team: " .$gsteam1." ".$gsscore1."<br><br>";// input from web based echo "[V]Team: " .$bteam." ".$bscore." Status: ".$bstatus. "<br>";// input from web based echo "[H]Team: " .$bteam1." ".$bscore1."<br><br>";// input from web based echo "[V]Team: " .$s1team." ".$s1score." Status: ".$s1status. "<br>";// input from web based echo "[H]Team: " .$s1team1." ".$s1score1."<br><br>";// input from web based echo "[V]Team: " .$s2team." ".$s2score." Status: ".$s2status. "<br>";// input from web based echo "[H]Team: " .$s2team1." ".$s2score1."<br><br>";// input from web based echo "[V]Team: " .$gteam." ".$gscore." Status: ".$gstatus. "<br>";// input from web based echo "[H]Team: " .$gteam1." ".$gscore1."<br><br>";// input from web based //close the connection mysql_close($dbhandle); ?> Quote Link to comment Share on other sites More sharing options...
Andy-H Posted October 28, 2010 Share Posted October 28, 2010 <?php # BEGINNING OF PHP! $gsteam= $_POST["gsteam"]; $gsteam1= $_POST["gsteam1"]; $gsstatus= $_POST["gsstatus"]; $gsscore= $_POST["gsscore"]; $gsscore1= $_POST["gsscore1"]; $bteam= $_POST["bteam"]; $bteam1= $_POST["bteam1"]; $bstatus= $_POST["bstatus"]; $bscore= $_POST["bscore"]; $bscore1= $_POST["bscore1"]; $s1team= $_POST["s1team"]; $s1team1= $_POST["s1team1"]; $s1status= $_POST["s1status"]; $s1score= $_POST["s1score"]; $s1score1= $_POST["s1score1"]; $s2team= $_POST["s2team"]; $s2team1= $_POST["s2team1"]; $s2status= $_POST["s2status"]; $s2score= $_POST["s2score"]; $s2score1= $_POST["s2score1"]; $gteam= $_POST["gteam"]; $gteam1= $_POST["gteam1"]; $gstatus= $_POST["gstatus"]; $gscore= $_POST["gscore"]; $gscore1= $_POST["gscore1"]; $username = "something"; $password = "something"; $hostname = "localhost"; //connection to the database $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL" .mysql_error()); echo "Connected to MySQL<br>"; //select a database to work with $selected = mysql_select_db("littleti_droid",$dbhandle) or die("Could not select examples" .mysql_error()); //insert data from php web page $query="INSERT INTO stats (gsteam, gsteam1, gsstatus, gsscore, gsscore1, bteam, bteam1, bstatus, bscore, bscore1, s1team, s1team1, s1status, s1score, s1score1, s2team, s2team1, s2status, s2score, s2score1, gteam, gteam1, gstatus, gscore, gscore1) VALUES ('".$gsteam."','".$gsteam1."','".$gsstatus."','".$gsscore."','".$gsscore1."','".$bteam."','".$bteam1."','".$bstatus."','".$bscore."','".$bscore1."','".$s1team."','".$s1team1."','".$s1status."','".$s1score."','".$s1score1."','".$s2team."','".$s2team1."','".$s2status."','".$s2score."','".$s2score1."','".$gteam."','".$gteam1."','".$gstatus."','".$gscore."','".$gscore1."')"; $result = mysql_query($query) or die(mysql_error()); //fetch tha data from the database echo "[V]Team: " .$gsteam." ".$gsscore." Status: ".$gsstatus. "<br>";// input from web based echo "[H]Team: " .$gsteam1." ".$gsscore1."<br><br>";// input from web based echo "[V]Team: " .$bteam." ".$bscore." Status: ".$bstatus. "<br>";// input from web based echo "[H]Team: " .$bteam1." ".$bscore1."<br><br>";// input from web based echo "[V]Team: " .$s1team." ".$s1score." Status: ".$s1status. "<br>";// input from web based echo "[H]Team: " .$s1team1." ".$s1score1."<br><br>";// input from web based echo "[V]Team: " .$s2team." ".$s2score." Status: ".$s2status. "<br>";// input from web based echo "[H]Team: " .$s2team1." ".$s2score1."<br><br>";// input from web based echo "[V]Team: " .$gteam." ".$gscore." Status: ".$gstatus. "<br>";// input from web based echo "[H]Team: " .$gteam1." ".$gscore1."<br><br>";// input from web based //close the connection mysql_close($dbhandle); ?> Can you post the ACTUAL code you have then, otherwise we can't really help... Also, take a look at extract, you can use it on the post superglobal array so you dont have to define so many variables i.e. $gsteam= $_POST["gsteam"]; $gsteam1= $_POST["gsteam1"]; $gsstatus= $_POST["gsstatus"]; $gsscore= $_POST["gsscore"]; $gsscore1= $_POST["gsscore1"]; $bteam= $_POST["bteam"]; $bteam1= $_POST["bteam1"]; $bstatus= $_POST["bstatus"]; $bscore= $_POST["bscore"]; $bscore1= $_POST["bscore1"]; $s1team= $_POST["s1team"]; $s1team1= $_POST["s1team1"]; $s1status= $_POST["s1status"]; $s1score= $_POST["s1score"]; $s1score1= $_POST["s1score1"]; $s2team= $_POST["s2team"]; $s2team1= $_POST["s2team1"]; $s2status= $_POST["s2status"]; $s2score= $_POST["s2score"]; $s2score1= $_POST["s2score1"]; $gteam= $_POST["gteam"]; $gteam1= $_POST["gteam1"]; $gstatus= $_POST["gstatus"]; $gscore= $_POST["gscore"]; $gscore1= $_POST["gscore1"]; //all of the above can be replaced by extract($_POST); Quote Link to comment Share on other sites More sharing options...
soccerrprp1 Posted October 28, 2010 Author Share Posted October 28, 2010 thanks andy, here is my php as is. the html page where data is entered and posted to db is as above: <?php # BEGINNING OF PHP! $gsteam= $_POST["gsteam"]; $gsteam1= $_POST["gsteam1"]; $gsstatus= $_POST["gsstatus"]; $gsscore= $_POST["gsscore"]; $gsscore1= $_POST["gsscore1"]; $bteam= $_POST["bteam"]; $bteam1= $_POST["bteam1"]; $bstatus= $_POST["bstatus"]; $bscore= $_POST["bscore"]; $bscore1= $_POST["bscore1"]; $s1team= $_POST["s1team"]; $s1team1= $_POST["s1team1"]; $s1status= $_POST["s1status"]; $s1score= $_POST["s1score"]; $s1score1= $_POST["s1score1"]; $s2team= $_POST["s2team"]; $s2team1= $_POST["s2team1"]; $s2status= $_POST["s2status"]; $s2score= $_POST["s2score"]; $s2score1= $_POST["s2score1"]; $gteam= $_POST["gteam"]; $gteam1= $_POST["gteam1"]; $gstatus= $_POST["gstatus"]; $gscore= $_POST["gscore"]; $gscore1= $_POST["gscore1"]; //$username = "littleti"; //$password = "password"; //$hostname = "localhost"; //connection to the database $dbhandle = mysql_connect("localhost","littleti_user","user") or die("Unable to connect to MySQL" .mysql_error()); echo "Connected to MySQL<br>"; //select a database to work with $selected = mysql_select_db("littleti_droid",$dbhandle) or die("Could not select examples" .mysql_error()); //insert data from php web page $query="INSERT INTO stats (gsteam, gsteam1, gsstatus, gsscore, gsscore1, bteam, bteam1, bstatus, bscore, bscore1, s1team, s1team1, s1status, s1score, s1score1, s2team, s2team1, s2status, s2score, s2score1, gteam, gteam1, gstatus, gscore, gscore1) VALUES ('".$gsteam."','".$gsteam1."','".$gsstatus."','".$gsscore."','".$gsscore1."','".$bteam."','".$bteam1."','".$bstatus."','".$bscore."','".$bscore1."','".$s1team."','".$s1team1."','".$s1status."','".$s1score."','".$s1score1."','".$s2team."','".$s2team1."','".$s2status."','".$s2score."','".$s2score1."','".$gteam."','".$gteam1."','".$gstatus."','".$gscore."','".$gscore1."')"; $result = mysql_query($query) or die(mysql_error()); //fetch tha data from the database echo "[V]Team: " .$gsteam." ".$gsscore." Status: ".$gsstatus. "<br>";// input from web based echo "[H]Team: " .$gsteam1." ".$gsscore1."<br><br>";// input from web based echo "[V]Team: " .$bteam." ".$bscore." Status: ".$bstatus. "<br>";// input from web based echo "[H]Team: " .$bteam1." ".$bscore1."<br><br>";// input from web based echo "[V]Team: " .$s1team." ".$s1score." Status: ".$s1status. "<br>";// input from web based echo "[H]Team: " .$s1team1." ".$s1score1."<br><br>";// input from web based echo "[V]Team: " .$s2team." ".$s2score." Status: ".$s2status. "<br>";// input from web based echo "[H]Team: " .$s2team1." ".$s2score1."<br><br>";// input from web based echo "[V]Team: " .$gteam." ".$gscore." Status: ".$gstatus. "<br>";// input from web based echo "[H]Team: " .$gteam1." ".$gscore1."<br><br>";// input from web based //close the connection mysql_close($dbhandle); ?> Quote Link to comment Share on other sites More sharing options...
pengu Posted October 28, 2010 Share Posted October 28, 2010 Not really relating to the code, but, can you wrap your CODE in the PHP tags. Quote Link to comment Share on other sites More sharing options...
soccerrprp1 Posted October 29, 2010 Author Share Posted October 29, 2010 I only see an insert query, if you wish to display data to users that didn't post the data you must select it from the database using a select query, then feth the data using a mysql_fetch function (such as mysql_fetch_row then display the fetched data accordingly. Once the page is refreshed, unless the browser is re-posting the data to php (probably the case), the values will disappear to the poster aswell as they haven't been posted... thanks Andy-H! Got it working! now issue of formatting to take care of Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.