put the mysql_db_query in an if() statement, more likley then not your select statement isnt returning any results.
-- Chris Lee [EMAIL PROTECTED] "Sc" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi; > > i keep getting an error of: Warning: Supplied argument is not a valid MySQL > result resource in /datascripts/insertdata.php on line 17... > > Line 17 is: $row = mysql_fetch_assoc($test); > > and here is the rest of it (not all of it though): > > for ($p = 1; $p <= 24; $p++) { > $test = mysql_db_query("melbourne", "SELECT * FROM 'Port$p' WHERE > 'Port$p'.date='$yesterday'"); > $row = mysql_fetch_assoc ($test); > $yindata = $row['switchin']; > $youtdata = $row['switchout']; > $dinPort = '$inPort$p' - $yindata; > $doutPort = '$outPort$p' - $youtdata; > > Can anyone help me overcome this prob? i've prob missed something without > thinking but i cant seem to get it... > > Thx. > > sc > > > -- PHP General 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]