abs0lut Posted May 5, 2008 Share Posted May 5, 2008 for ($i=0; $i<count($niqid); $i++) { $total=($quanti) * ($niqid[$i]); $query = "INSERT INTO comments (author, itemname, price, total, date, post) VALUES ('$author', '".$niqid[$i]."', '".$_POST['price'][$i]."', '$total', '$date', '$post')"; $sql = mysql_query($query) or die (mysql_error()); } please help me.. Link to comment https://forums.phpfreaks.com/topic/104156-fatal-error-unsupported-operand-types-in/ Share on other sites More sharing options...
Fadion Posted May 5, 2008 Share Posted May 5, 2008 Whats the full error? What line? Link to comment https://forums.phpfreaks.com/topic/104156-fatal-error-unsupported-operand-types-in/#findComment-533227 Share on other sites More sharing options...
abs0lut Posted May 5, 2008 Author Share Posted May 5, 2008 in this line $total=($quanti) * ($niqid[$i]); Link to comment https://forums.phpfreaks.com/topic/104156-fatal-error-unsupported-operand-types-in/#findComment-533233 Share on other sites More sharing options...
Fadion Posted May 5, 2008 Share Posted May 5, 2008 Most surely $quanti and $niqid[$i] arent numbers. Try a var_dump($quanti) and var_dump($niqid[$i]) and see if they return as int or float. If not, try adding a intval() or floatval() and make sure ure passing numbers to those variables. $total = intval($quanti) * intval($niqid[$i]); Link to comment https://forums.phpfreaks.com/topic/104156-fatal-error-unsupported-operand-types-in/#findComment-533419 Share on other sites More sharing options...
abs0lut Posted May 5, 2008 Author Share Posted May 5, 2008 thank you GuiltyGear Link to comment https://forums.phpfreaks.com/topic/104156-fatal-error-unsupported-operand-types-in/#findComment-533867 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.