Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3273362
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:55:26+00:00 2026-05-17T18:55:26+00:00

I have a curious problem that I hope is something stupid I overlooked. I

  • 0

I have a curious problem that I hope is something stupid I overlooked.

I am getting an error that usually occurs when there is a missing column in a mysql table, or a misspelled php variable: “Unknown column ‘Bob’ in ‘field list'”…

Except ‘Bob’ is not the name of a column, its the VALUE I am trying to assign to the row. Why would php be confusing the two??

Here is my php function that I believe is the location of the error:

function recordGuest($id,$fname,$lname,$dinner){
    $conn = connect("wedding");
    $guest_query = "INSERT INTO guest (fname,lname,person_id)
                    VALUES (".$fname.",".$lname.",".$id.");";
    mysql_query($guest_query,$conn) or die(mysql_error());

    $guest_id_query = "SELECT id FROM guest WHERE person_id = ".$id.";";
    $guest_id_result = mysql_query($guest_id_query,$conn) or die(mysql_error());
    $guest_id = "";
    while($row = mysql_fetch_array($guest_id_result)){
        $guest_id = $row["id"];
    }

    $guest_dinner_query = " INSERT INTO guest_dinner (dinner_id,guest_id)
                            VALUES (".$dinner.",".$guest_id.");";
    mysql_query($guest_dinner_query,$conn) or die(mysql_error());
}

Here is the php code that processes the form and executes the above function:

<?php
include("functions.php");

$code = $_POST["code"];
$type = $_POST["type"];
$people = getPeople($code);
$ids = $people["ids"];
$email= "";

for($i = 0; $i < count($ids); $i++){
    $response = $_POST["response_".$i];
    $dinner = $_POST["dinner_".$i];
    recordResponse($ids[$i],$response);
    if($dinner != "null"){
        recordDinner($ids[$i],$dinner);
    }
    if($type == 3){
        $guest_responses = $_POST["guest_response_".$i];
        $guest_fname = $_POST["guest_fname_".$i];
        $guest_lname = $_POST["guest_lname_".$i];
        $guest_dinner_response = $_POST["guest_dinner_response_".$i];
        if($guest_dinner_response != "null"){
            recordGuest($ids[$i],$guest_fname,$guest_lname,$guest_dinner_response);
        }
    }
}
?>

Heres what my “guest” mysql table looks like:

guest
    id int auto inc (primary key)
    fname varchar
    lname varchar
    person_id int

Any help would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:55:26+00:00Added an answer on May 17, 2026 at 6:55 pm

    Enclose the string in single quotes i.e. ‘Bob’ before trying to insert the string values

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, I am seeing a curious problem. If I have a function // counter
I have a curious question about efficiency. Say I have a field on a
curious if anyone might have some insight in how I would do the following
I'm curious what tools people have found useful for building flowcharts. Obviously MS Visio
I am curious what strategies folks have found for unit testing a data access
I have been reading through the C++ FAQ and was curious about the friend
I'm curious as to what type of experiences people have had with libgd. I
I curious to how different people solve integration of systems. I have a feeling
I have been using IoC for a little while now and I am curious
I have downloaded Privoxy few weeks ago and for the fun I was curious

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.