Jump to content

Fatal error: Unsupported operand types in...


abs0lut

Recommended Posts

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..

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]);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.