mysql query php code

I’m a beginner and havent done much coding in a while; I built the below but I keep getting the die message. I am connecting to the db just fine and I’ve verified my variables are being passed from the form. thoughts???

$query = “INSERT INTO nomad (period, type, fn, ln, street, street2, city, state, zip, country, phone, email, byear, student, idme, ftrip, other, airfare, essay) VALUES (’$period’, ‘$type’, ‘$fn’, ‘$ln’, ‘$street’, ‘$street2’, ‘$city’, ‘$state’, ‘$zip’, ‘$country’, ‘$phone’, ‘$email’, ‘$byear’, ‘$student’, ‘$idme’, ‘$ftrip’, ‘$other’, ‘$airfare’, ‘$essay’)”;

$result = mysql_query($query) or die (“Couldn’t insert into nomad with application info”);

You aren’t going to find help here using outdated code, it just isn’t worth our time.

Toss your code and learn PDO.

https://phpdelusions.net/pdo

Sponsor our Newsletter | Privacy Policy | Terms of Service