php - Can't seem to get query to work? -
<?php error_reporting(e_all); session_start(); include ('connect.php'); if(!empty($_post['budgetbox'])) { $budgetboxvar = $_post['budgetbox']; $sql="insert users username = '".$_session['usernamebox']."'(budget) values ('$budgetboxvar')"; mysqli_query($db,$sql); } ?>
does have idea why code above doesn't work ? seems code works if leave code below out. i'm sorry can't seem figure out how not correct ? i'm not getting error messages either.
when take out when username session usernamebox
part out.. query input database, not in field of logged in user..
i tried echo if query succeeded doesn't show either.. means query can't executed (i think). can't figure out why though(it's hard being noob sometimes)
thank in advance, hope can !
if understand correctly, this:
$sql = "update users set budget='".$budgetboxvar."' username = '".$_session['usernamebox'];