[PHP-DB] multi-dimensional array

2002-01-24 Thread tomhilton

Hi,
I am trying to load a multi-dimensional array to my mysql database and am
having difficulty reading the array.
I created the array in a script, and sent it to another script through a
form.  One of the variables that gets passed is "$home_team[][]. with the
outer array being the week #, and the inner array being the home team id#.
Through PHP INFO function, I can see the array exists and has valid values
  HTTP_POST_VARS["home_team"] Array
(
[1] => Array
(
[1] => 1
[2] => 3
)

[2] => Array
(
[1] => 2
[2] => 4
)

[3] => Array
(
[1] => 1
[2] => 2
)

[4] => Array
(
[1] => 3
[2] => 4
)

[5] => Array
(
[1] => 4
[2] => 2
)

[6] => Array
(
[1] => 3
[2] => 1
)

)


 When I try to view the information as a table, below is what I get:
 week_num flight_id match_date match_num home_team_id away_team_id
  1 1 2002-01-01 1 Array[1] Array[1]
  1 1 2002-01-01 2 Array[2] Array[2]
  2 1 2002-01-08 1 Array[1] Array[1]
  2 1 2002-01-08 2 Array[2] Array[2]
  3 1 2002-01-15 1 Array[1] Array[1]
  3 1 2002-01-15 2 Array[2] Array[2]
  4 1 2002-02-05 1 Array[1] Array[1]
  4 1 2002-02-05 2 Array[2] Array[2]
  5 1 2002-02-12 1 Array[1] Array[1]
  5 1 2002-02-12 2 Array[2] Array[2]
  6 1 2002-02-19 1 Array[1] Array[1]
  6 1 2002-02-19 2 Array[2] Array[2]

The script that generated this table is calling for $home_team[$b][$c],
where $b=The Week #(1-6), and $c=match#(1-2).
I dont understand why it is outputting "Array[1] or Array[2] instead of the
home team id#, that I see is getting passed.  Can anyone please help?



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] string compare function

2002-01-17 Thread tomhilton

Hi, this is more of an earlier post regarding the strcmp function and my
problems with it on my Win98 machine.

This is the actual code I used for the strcmp function,


$errors=0;

if (empty($username)||empty($pword)||empty ($conf_pword)||empty($redirect))
 {
 echo "Please hit your browser's back button and fill in all
fields";
 $errors++;
 }

$comp=strcmp($conf_pword,$pword);
echo $comp;


The result ($comp) always comes back -1 when $pword is the 2nd variable, and
+1 when $pword is the 1st variable.  It doesn't matter what the input is
into the variables from the form the data comes from.  Is it comparing the
actual literals of the variable names?



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] string compare function

2002-01-17 Thread tomhilton

Hi, I'm having a problem with the stcmp() function.  I have it comparing two
string variables, $pword and $conf_pword, in a script.  I know they both
have values, but the result always compares to 1 when $pword is the first
variable in the function, and -1 when $pword is the 2nd variable in the
function, no matter what string values are in the variables.  It seems like
the function is comparing the literal name "$pword" and "$conf_pword", not
their values.   I am working on a Win98 machine, does anyone have any
suggestions as to what I'm doing wrong?  Any help would be greatly
appreciated



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]