hi all
this is probably another simple one, but the web doesnt seem to have an
answer that I can find.
Veeeery simple code. each row has 10 columns.
require('db.php ');
$query = "SELECT * FROM mytable";
$result = mysql_query($qu ery);
$numrows = mysql_num_rows( $result);
for($x=0; $x<$numrows; $x++)
$row_arrays[$x] = mysql_fetch_arr ay($result);
//test row 1
foreach($row_ar rays[1] as $count)
print "$count<br> ";
result for each print is the column number (0-9) and each id(0,a,1,b,2,c
etc). But if I use mysql_fetch_arr ay($result, 'MSQL_ASSOC') as the docs
say, I get the 'The result type should be either MYSQL_NUM, MYSQL_ASSOC or
MYSQL_BOTH' error. No quotes, additional error about undefined constant. I
figure using this would get the array including the id only and not include
the number. Perhaps its the wrong assumption?
thanks
this is probably another simple one, but the web doesnt seem to have an
answer that I can find.
Veeeery simple code. each row has 10 columns.
require('db.php ');
$query = "SELECT * FROM mytable";
$result = mysql_query($qu ery);
$numrows = mysql_num_rows( $result);
for($x=0; $x<$numrows; $x++)
$row_arrays[$x] = mysql_fetch_arr ay($result);
//test row 1
foreach($row_ar rays[1] as $count)
print "$count<br> ";
result for each print is the column number (0-9) and each id(0,a,1,b,2,c
etc). But if I use mysql_fetch_arr ay($result, 'MSQL_ASSOC') as the docs
say, I get the 'The result type should be either MYSQL_NUM, MYSQL_ASSOC or
MYSQL_BOTH' error. No quotes, additional error about undefined constant. I
figure using this would get the array including the id only and not include
the number. Perhaps its the wrong assumption?
thanks
Comment