php arrays, mysql, and post forms - SOLVED

Hi everyone. What I am trying to do is create a system that ultimately grabs information from a mysql table and allow me to update it.

Currently, I have created a form in a while-loop that sets up the user-interface. I am right now trying to get it to post to a separate page, and from there output only the row that does not have equal fields where the user can input information. This is the beginning step to test to make sure everything is posting correctly.

The 2 web pages are:

Submit Score code looks like this:
{database info here}

<? $query="SELECT GameID,Date,Away,AwayScore,Home,HomeScore FROM 2008sched WHERE AwayScore IS NULL ORDER BY GameID ASC LIMIT 12"; $result=mysql_query($query) or die(mysql_error()); $num=mysql_numrows($result); ?> <? $i=0;

while ($i < $num) {


 <?  $i++; } ?>
GameID Date Away Away Score Home Home Score
<? echo '';?> <? echo '';?> <? echo '';?> <? echo '';?> <? echo '';?> <? echo '';?>


<? mysql_close(); ?>

scresults.php looks like this:

{database info}

for ($x=0; $x<$num; $x++) {
	echo $gidarray[$x].'<br>'.$dtarray[$x].'<br>'.$haarray[$x]." ".$hscore[$x].'<br>'.$aarray[$x]." ".$ascore[$x].'<br><br>';
for ($y=0; $y<$num; $y++) {
	if ($ascore[$x] == $hscore[$x]) {
		print_r ($gidarray[$x]);
		echo '<br>';

mysql_close(); ?>

My scresults.php shows up blank. If you have any suggestions, I am all ears.

Thanks in advance,

You’re going to have to give us a little more information. What do you get if you use error_reporting(E_ALL)? See also debugging tips (link in my signature).

Thanks for the reply. After adding the error reporting in, without an echo, it is still a blank window. With an echo, it outputs the numbers ‘20397’.

I figured it out. The $num was not moving to the action page from the original page.

Sponsor our Newsletter | Privacy Policy | Terms of Service