Jump to content

help on my submitting updates to database


pixeltrace

Recommended Posts

guys,

i need help on this, i have to page
1 - for the form page (wherein i fill up the form and submit)
2 - confirmation page (this page will check the data and submit it to my database)

my problem is i keep on getting the error messages that i made although the fields that needs to be
fillup are inputted.

also i have a condition here
- if my $EventImage is fillup, it will submit '2' as the value of $EventImageLink otherwise, it will submit '1' as its value
- if $Eventpopup is not filled up, it will just submit '1' as the value of $Eventpopup
Link to comment
Share on other sites

this is the script for my form page
--------------------
<TBODY>
    <TR><TD vAlign=top><form id="form1" name="form1" method="post" action="eventupdate.php">
      <table width="761" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="435"><table width="431" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td colspan="2" class="bodytext3">Add Sinagtala Events Here </td>
            </tr>
            <tr>
              <td colspan="2"><img src="../images/spacer.gif" width="10" height="30" /></td>
            </tr>
            <tr>
              <td width="97" class="bodytext3">Event Title: </td>
              <td width="334"><input name="EventTitle" type="text" class="newsletter" size="50" maxlength="100" />              </td>
            </tr>
            <tr>
              <td colspan="2" class="bodytext3"><img src="../images/spacer.gif" width="10" height="10" /></td>
            </tr>
            <tr>
              <td class="bodytext3">Event Type : </td>
              <td><input name="EventType" type="text" class="newsletter" size="50" maxlength="100" /></td>
            </tr>
            <tr>
              <td class="bodytext3">&nbsp;</td>
              <td><span class="bodytext2">event types:</span><span class="bodytext6"> corporate, past, private, sponsored, tour</span> </td>
            </tr>
            <tr>
              <td colspan="2" class="bodytext3"><img src="../images/spacer.gif" width="10" height="10" /></td>
            </tr>
            <tr>
              <td class="bodytext3">Event Date </td>
              <td><input name="EventDate" type="text" class="newsletter" size="20" maxlength="100" />
                  <span class="bodytext2">Format:</span><span class="bodytext6"> YY MD (eg. 2005 jan01)</span> </td>
            </tr>
            <tr>
              <td class="bodytext3">Description:</td>
              <td><textarea name="EventDescription" cols="50" rows="10" class="newsletter2"></textarea></td>
            </tr>
            <tr>
              <td colspan="2" class="bodytext3"><img src="../images/spacer.gif" width="10" height="10" /></td>
            </tr>
            <tr>
              <td class="bodytext3">image name: </td>
              <td><input name="EventImage" type="text" class="newsletter" size="25" maxlength="100" />                </td>
            </tr>
            <tr>
              <td class="bodytext3">&nbsp;</td>
              <td>&nbsp;<span class="bodytext2">* image name is the image filename</span></td>
            </tr>
            <tr>
              <td colspan="2" class="bodytext3"><img src="../images/spacer.gif" width="10" height="10" /></td>
            </tr>
            <tr>
              <td class="bodytext3">pop-up link </td>
              <td><input name="Eventpopup" type="text" class="newsletter" size="25" maxlength="100" /></td>
            </tr>
            <tr>
              <td class="bodytext3">&nbsp;</td>
              <td>&nbsp;<span class="bodytext2">* pop-up link is the pop-up pagename </span></td>
            </tr>
            <tr>
              <td colspan="2"><img src="../images/spacer.gif" width="10" height="10" /></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td><input class="mybutton" type="submit" name="Submit" value="SUBMIT" /></td>
            </tr>
            <tr>
              <td colspan="2">&nbsp;</td>
            </tr>
          </table></td>
          <td width="11"><span class="bodytext3"><img src="../images/spacer.gif" width="10" height="10" /></span></td>
          <td width="1" bgcolor="#A2330F"><span class="bodytext3"><img src="../images/spacer.gif" width="1" height="10" /></span></td>
          <td width="11"><span class="bodytext3"><img src="../images/spacer.gif" width="10" height="10" /></span></td>
          <td width="292" valign="top"><div align="center" class="bodytext3"><br><br>On this page, you can add Sinagtala Events<br> using the form on the left side. </div></td>
          <td width="11"><span class="bodytext3"><img src="../images/spacer.gif" width="10" height="10" /></span></td>
        </tr>
      </table>
    </form>

----------------------------
 
Link to comment
Share on other sites

In the long if statement that checks to see if the fields were inputted, two of them don't have exclamation marks. ($EventImage and $Eventpopup)

So the if statement returns true no matter what. So either remove those two from the if statement or add exclamation marks to them like the others.
Link to comment
Share on other sites

i just remove the $eventimage and $eventpopup

and then, i tried checking it by filling up all the fields in the form
and this is the error message after clicking the submit button
---------------
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '', '')' at line 2
---------------
whats wrong with my script?
i need help on this
thanks!
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.