php - Inserting Integer value into mysql int using INSERT -


i'm trying insert new record in mysql database php, i've done million times before, reason, can't work time, , bugs me.

inserting strings varchar collumns going great, when inserting value int column, error telling me have syntax error.

basically, first query works fine, second 1 returns error, , can see, i've made damn sure integer i'm trying insert.

i hope can help. i'm starting develop headache on :/

$groupid2 = 5; $groupid = (int)$groupid2; if(!mysqli_query($link, "insert contestants (firstname, lastname, email) values ('$firstname', '$lastname', '$email')"))   echo "first: " . mysqli_error($link); if(!mysqli_query($link, "insert contestants (firstname, lastname, email, group) values ('$firstname', '$lastname', '$email', '$groupid')"))   echo "second: " . mysqli_error($link); 

group mysql keyword use quotes around it

"insert contestants (firstname, lastname, email, `group`)   values ('$firstname', '$lastname', '$email', '$groupid')" 

Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -