Body: <p>I've just upgraded to the latest version of Craft on a site that uses the Guest Entries plugin. While it was fine before hand, I'm now running into the titled issue.</p>
  
  <p>Has anyone run into this before?</p>
  
  <p>Here's the entry form</p>
  
  <pre><code>&lt;form class="hard" method="post" action="" accept-charset="UTF-8"&gt;
        {{ getCsrfInput() }}
        &lt;input type="hidden" name="action" value="guestEntries/saveEntry"&gt;
        &lt;input type="hidden" name="redirect" value="{{ craft.request.url }}?registrationSuccess"&gt;
        &lt;input type="hidden" name="sectionId" value="16"&gt;
        &lt;input type="hidden" name="postDate" value="{{ now|date("Y-m-j H:i:s") }}"&gt;
        &lt;input type="hidden" name="fields[event][]" value="{{ relatedEvent.first.id }}"&gt;
        &lt;input type="hidden" name="title" value="Registration for {{ relatedEvent.first.title }} | Event ID {{ relatedEvent.first.id }} on {{ now|date("Y-m-j H:i:s") }}"&gt;
        &lt;p&gt;&lt;label for="firstName"&gt;Parent first name &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt;
          &lt;input id="firstName" required placeholder="John" type="text" name="fields[firstName]"&gt;
        &lt;/p&gt;
        &lt;p&gt;&lt;label for="lastName"&gt;Parent last name &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt;
          &lt;input id="lastName" required placeholder="Doe" type="text" name="fields[lastName]"&gt;
        &lt;/p&gt;
        &lt;p&gt;&lt;label for="email"&gt;Your email &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt;
          &lt;input id="email" required placeholder="me@harvestglasgow.org" type="email" name="fields[email]"&gt;
        &lt;/p&gt;
        &lt;p&gt;&lt;label for="streetAddress"&gt;Street address &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt;
          &lt;input id="streetAddress" required placeholder="29 Acacia Road" type="text" name="fields[streetAddress]"&gt;
        &lt;/p&gt;
        &lt;p&gt;&lt;label for="town"&gt;Town &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt;
          &lt;input id="town" required placeholder="Glasgow" type="text" name="fields[town]"&gt;
        &lt;/p&gt;
        &lt;p&gt;&lt;label for="postcode"&gt;Postcode &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt;
          &lt;input id="postcode" required placeholder="G72 1JP" type="text" name="fields[postcode]"&gt;
        &lt;/p&gt;
        &lt;p&gt;&lt;label for="phone"&gt;Your phone &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt;
          &lt;input id="phone" placeholder="07766123456" type="tel" name="fields[phone]" required&gt;
        &lt;/p&gt;
        &lt;p&gt;&lt;label for="emergencyContactName"&gt;First emergency contact name &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt;
          &lt;input id="emergencyContactName" placeholder="" type="text" name="fields[emergencyContactName]" required&gt;
        &lt;/p&gt;
        &lt;p&gt;&lt;label for="emergencyContactNumber"&gt;First emergency contact phone &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt;
          &lt;input id="emergencyContactNumber" placeholder="07766505050" type="tel" name="fields[emergencyContactNumber]" required&gt;
        &lt;/p&gt;
        &lt;p&gt;&lt;label for="emergencyContactName2"&gt;Second emergency contact name &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt;
          &lt;input id="emergencyContactName2" placeholder="" type="text" name="fields[emergencyContactName2]" required&gt;
        &lt;/p&gt;
        &lt;p&gt;&lt;label for="emergencyContactNumber2"&gt;Second emergency contact phone &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt;
          &lt;input id="emergencyContactNumber2" placeholder="07766505050" type="tel" name="fields[emergencyContactNumber2]" required&gt;
        &lt;/p&gt;
        &lt;p&gt;&lt;label for="eventKids"&gt;How many kids are you registering? &lt;span class="required"&gt;*&lt;/span&gt;&lt;/label&gt;
          &lt;input type="number" placeholder="1" id="eventKids" name="fields[eventKids]" required&gt;&lt;/p&gt;
        &lt;p&gt;&lt;label for="friends"&gt;Other friends attending&lt;/label&gt;
          &lt;textarea name="fields[friends]" placeholder="if your kid has any friends attending holiday club, let us know and we'll try group them together" id="friends" cols="30" rows="10"&gt;&lt;/textarea&gt;
        &lt;/p&gt;
        &lt;p&gt;&lt;label for="specialRequirements"&gt;Any special requirements?&lt;/label&gt;
          &lt;textarea name="fields[specialRequirements]" placeholder="if there's any dietary requirements or other needs that we should know about, please let us know" id="specialRequirements" cols="30" rows="10"&gt;&lt;/textarea&gt;
        &lt;/p&gt;
        &lt;p&gt;&lt;label&gt;Add your kid's information&lt;/label&gt;
        &lt;/p&gt;
        &lt;table class="table table-bordered table-hover" id="tab_logic"&gt;
          &lt;thead&gt;
            &lt;tr&gt;
              &lt;th&gt;Name&lt;/th&gt;
              &lt;th&gt;Age&lt;/th&gt;
              &lt;th&gt;DoB&lt;/th&gt;
              &lt;th&gt;School Year @ May 2017&lt;/th&gt;
            &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
          &lt;tr id='addr0'&gt;
            &lt;td width="30%"&gt;
              &lt;input type="text" name="fields[kidsInformation][0][col1]" placeholder="Name"&gt;
            &lt;/td&gt;
            &lt;td width="13%"&gt;
              &lt;input type="number" min="4" max="12" name="fields[kidsInformation][0][col2]" placeholder="7"&gt;
            &lt;/td&gt;
            &lt;td width="20%"&gt;
              &lt;input type="date" name="fields[kidsInformation][0][col3]" placeholder="22/03/2008"&gt;
            &lt;/td&gt;
            &lt;td width="25%"&gt;
              &lt;input type="text" name="fields[kidsInformation][0][col4]" placeholder="P4"&gt;
            &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr id='addr1'&gt;&lt;/tr&gt;
          &lt;/tbody&gt;
        &lt;/table&gt;
  
        &lt;a id="add_row" class="btn btn-default pull-left  btn--small"&gt;Add Kid&lt;/a&gt;&lt;a id='delete_row' class="pull-right btn btn-default btn--small"&gt;Remove Kid&lt;/a&gt;
  
        &lt;p&gt;
          &lt;label for="photographPermission"&gt;I give permission for my kid to be photographed and understand that photos may be used for future Harvest Glasgow event promotions. We will also make photographs available for parents to download from our website&lt;/label&gt;
  
          &lt;input type="radio" name="fields[photoPermission]" value="Yes" checked&gt; Yes, I'm happy with that&lt;br&gt;
          &lt;input type="radio" name="fields[photoPermission]" value="No"&gt; No, I don't want any pictures of my kid taken
        &lt;/p&gt;
  
        &lt;button id="submit" type="submit" class="ready submit"&gt;Register&lt;/button&gt;
      &lt;/form&gt;
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-02T03:18:17.540Z
Comments.Text: What version of Guest Entries are you on?  The (current) latest for Craft 2 is 1.5.2 (https://github.com/craftcms/guest-entries/releases/tag/1.5.2)
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-02T06:36:40.210Z
Comments.Text: Sorry, should have said I upgraded Guest Entries first before Craft so the site is using 1.5.2
Comments.UserDisplayName: Steven Grant
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-08-03T19:42:56.730Z
Comments.Text: Hrm... I'd probably start to narrow down the form field to try and figure out which one(s) are causing the error.  My guess is there is some data not getting passed in properly.
Comments.UserDisplayName: Brad Bell
Tags: <guest-entries><plugin-guestentries><frontend-form>
Title: CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'targetId' at row 1
ThreadText: # CDbCommand failed to execute the SQL statement: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'targetId' at row 1
  
  (Asked by: username_0 on 2017-08-01)
  
  I've just upgraded to the latest version of Craft on a site that uses the Guest Entries plugin. While it was fine before hand, I'm now running into the titled issue.
  
  Has anyone run into this before?
  
  Here's the entry form
  
  ```
  <form class="hard" method="post" action="" accept-charset="UTF-8">
        {{ getCsrfInput() }}
        <input type="hidden" name="action" value="guestEntries/saveEntry">
        <input type="hidden" name="redirect" value="{{ craft.request.url }}?registrationSuccess">
        <input type="hidden" name="sectionId" value="16">
        <input type="hidden" name="postDate" value="{{ now|date("Y-m-j H:i:s") }}">
        <input type="hidden" name="fields[event][]" value="{{ relatedEvent.first.id }}">
        <input type="hidden" name="title" value="Registration for {{ relatedEvent.first.title }} | Event ID {{ relatedEvent.first.id }} on {{ now|date("Y-m-j H:i:s") }}">
        <p><label for="firstName">Parent first name <span class="required">*</span></label>
          <input id="firstName" required placeholder="John" type="text" name="fields[firstName]">
        </p>
        <p><label for="lastName">Parent last name <span class="required">*</span></label>
          <input id="lastName" required placeholder="Doe" type="text" name="fields[lastName]">
        </p>
        <p><label for="email">Your email <span class="required">*</span></label>
          <input id="email" required placeholder="me@harvestglasgow.org" type="email" name="fields[email]">
        </p>
        <p><label for="streetAddress">Street address <span class="required">*</span></label>
          <input id="streetAddress" required placeholder="29 Acacia Road" type="text" name="fields[streetAddress]">
        </p>
        <p><label for="town">Town <span class="required">*</span></label>
          <input id="town" required placeholder="Glasgow" type="text" name="fields[town]">
        </p>
        <p><label for="postcode">Postcode <span class="required">*</span></label>
          <input id="postcode" required placeholder="G72 1JP" type="text" name="fields[postcode]">
        </p>
        <p><label for="phone">Your phone <span class="required">*</span></label>
          <input id="phone" placeholder="07766123456" type="tel" name="fields[phone]" required>
        </p>
        <p><label for="emergencyContactName">First emergency contact name <span class="required">*</span></label>
          <input id="emergencyContactName" placeholder="" type="text" name="fields[emergencyContactName]" required>
        </p>
        <p><label for="emergencyContactNumber">First emergency contact phone <span class="required">*</span></label>
          <input id="emergencyContactNumber" placeholder="07766505050" type="tel" name="fields[emergencyContactNumber]" required>
        </p>
        <p><label for="emergencyContactName2">Second emergency contact name <span class="required">*</span></label>
          <input id="emergencyContactName2" placeholder="" type="text" name="fields[emergencyContactName2]" required>
        </p>
        <p><label for="emergencyContactNumber2">Second emergency contact phone <span class="required">*</span></label>
          <input id="emergencyContactNumber2" placeholder="07766505050" type="tel" name="fields[emergencyContactNumber2]" required>
        </p>
        <p><label for="eventKids">How many kids are you registering? <span class="required">*</span></label>
          <input type="number" placeholder="1" id="eventKids" name="fields[eventKids]" required></p>
        <p><label for="friends">Other friends attending</label>
          <textarea name="fields[friends]" placeholder="if your kid has any friends attending holiday club, let us know and we'll try group them together" id="friends" cols="30" rows="10"></textarea>
        </p>
        <p><label for="specialRequirements">Any special requirements?</label>
          <textarea name="fields[specialRequirements]" placeholder="if there's any dietary requirements or other needs that we should know about, please let us know" id="specialRequirements" cols="30" rows="10"></textarea>
        </p>
        <p><label>Add your kid's information</label>
        </p>
        <table class="table table-bordered table-hover" id="tab_logic">
          <thead>
            <tr>
              <th>Name</th>
              <th>Age</th>
              <th>DoB</th>
              <th>School Year @ May 2017</th>
            </tr>
          </thead>
          <tbody>
          <tr id='addr0'>
            <td width="30%">
              <input type="text" name="fields[kidsInformation][0][col1]" placeholder="Name">
            </td>
            <td width="13%">
              <input type="number" min="4" max="12" name="fields[kidsInformation][0][col2]" placeholder="7">
            </td>
            <td width="20%">
              <input type="date" name="fields[kidsInformation][0][col3]" placeholder="22/03/2008">
            </td>
            <td width="25%">
              <input type="text" name="fields[kidsInformation][0][col4]" placeholder="P4">
            </td>
          </tr>
          <tr id='addr1'></tr>
          </tbody>
        </table>
  
        <a id="add_row" class="btn btn-default pull-left  btn--small">Add Kid</a><a id='delete_row' class="pull-right btn btn-default btn--small">Remove Kid</a>
  
        <p>
          <label for="photographPermission">I give permission for my kid to be photographed and understand that photos may be used for future Harvest Glasgow event promotions. We will also make photographs available for parents to download from our website</label>
  
          <input type="radio" name="fields[photoPermission]" value="Yes" checked> Yes, I'm happy with that<br>
          <input type="radio" name="fields[photoPermission]" value="No"> No, I don't want any pictures of my kid taken
        </p>
  
        <button id="submit" type="submit" class="ready submit">Register</button>
      </form>
  
  ```
  
  **Tags:** guest-entries, plugin-guestentries, frontend-form
  
  > **Comments:**
  > **username_1**: What version of Guest Entries are you on?  The (current) latest for Craft 2 is 1.5.2 (https://github.com/craftcms/guest-entries/releases/tag/1.5.2)  
  > **username_0**: Sorry, should have said I upgraded Guest Entries first before Craft so the site is using 1.5.2  
  > **username_1**: Hrm... I'd probably start to narrow down the form field to try and figure out which one(s) are causing the error.  My guess is there is some data not getting passed in properly.  
  
  ---
  
  ## 0 answers
  
  