...

I just don't get why this isn't working!

slaskis
09-03-2002, 08:10 PM
I just can't see the error here:

$con = mysql_connect($db_host, $db_username, $db_password);
mysql_select_db($db_database);
$result = mysql_query("SELECT * FROM $db_table[0] WHERE poll_id = $id",$con);
while ($myrow = mysql_fetch_array($result, MYSQL_BOTH)) {
echo"working";
}

Anyone?

It's in php just so you know and i get the error:

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in d:\www\thespot\functions.inc.php on line 33

(line 33 is the while line)

mat
09-14-2002, 04:41 AM
what does MYSQL_BOTH do?

Ökii
09-14-2002, 08:53 AM
Try dropping all the superflous parameters and see if it runs

$con = mysql_connect($db_host, $db_username, $db_password);
mysql_select_db($db_database);
$result = mysql_query("SELECT * FROM '$db_table[0]' WHERE poll_id = '$id'");
while ($myrow = mysql_fetch_array($result)) {
echo 'working - '.$myrow[0].'<br>
';
}
echo mysql_error();

If that still throws probs, you might try mysql_fetch_row and test again. The mysql_error output should point toward mysqls version of what is glitching.

MYSQL BOTH just tells mysql to return rows in arrays that are indexed by both the numeric $array[0] and by association $array[fieldname]



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum