0
$a=$_POST['stock']; $b=$_POST['qty']; $c=$a+$b; echo $c; When i execute this i get this error A non numeric value encoutered
Even i use intval() for the two vatiables When i put stock=1 qty=1 Output of c:1 What's the problem
3 ответов
+ 1
$_POST isn't a numeric value i suppose.
0
When i convert to intval($a)
Intval($b)
Input
Stock:2
Qty:1
Output:
1
First variable value is taking to zero
What might be proble..
0
Print value of <$a> and <$b> before anything, see whether they contain valid data for addition into <$c>. Even better print value of $_POST["stock"] and $_POST["qty"] to be more convinced.