Jump to content


Photo

help on my submitting updates to database


  • Please log in to reply
5 replies to this topic

#1 pixeltrace

pixeltrace
  • Members
  • PipPipPip
  • Advanced Member
  • 577 posts

Posted 19 August 2006 - 08:36 PM

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

#2 pixeltrace

pixeltrace
  • Members
  • PipPipPip
  • Advanced Member
  • 577 posts

Posted 19 August 2006 - 08:37 PM

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>

----------------------------
 

#3 pixeltrace

pixeltrace
  • Members
  • PipPipPip
  • Advanced Member
  • 577 posts

Posted 19 August 2006 - 08:40 PM

this is the sript for my confirmation page
--------------------
http://www.sinagtala...ventupdate.phps
--------------------

thanks in advance!

#4 Jeremysr

Jeremysr
  • Members
  • PipPipPip
  • Advanced Member
  • 199 posts
  • LocationSaskatchewan, Canada

Posted 19 August 2006 - 08:45 PM

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.

#5 pixeltrace

pixeltrace
  • Members
  • PipPipPip
  • Advanced Member
  • 577 posts

Posted 19 August 2006 - 09:48 PM

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!

#6 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 19 August 2006 - 09:51 PM

$EventImageLink' should be '$EventImageLink' in the SQL query
Legend has it that reading the manual never killed anyone.
My site




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users