0

Dear Friends.
When i going to UPDATE data of the database using UPDATE function in PHP, following message displays,
What should I do?

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 ':If_Any_01='Test', History/Remarks=NULL, Doc_2:Minute=0, Doc_2:BD=0, Doc' at line 1

3
Contributors
9
Replies
33
Views
4 Years
Discussion Span
Last Post by Shalomd
1

The colons and slashes are messing it up. In addition to the code, show your table structure too.

0

Code (Too long)

<?php
// Retreving data from URL
if(!empty($_GET['id']))
{
$id=$_GET['id']; // ID of a fund
$database=$_GET['db']; // Database
$table=$_GET['cat']; // Category or Table

// Building a Database connection
$host="localhost"; // host
$user="root"; // User Name
$pass=""; // Password
$db=$_GET['db']; // Database. Database retreving from URL
$database=strtolower($db); //lowercasing all letters
echo $database;
$table=$_GET['cat']; // Database Table. Data retreving from URL

$connect=mysql_connect($host,$user,$pass)or die("<b>Unable to start a connection with database.</b> <br>Please contact your Web Administrator");
mysql_select_db($database,$connect)or die("<b>Unable to catch the database</b><br> Please contact your Web Administrator");
}

$query=mysql_query("SELECT * FROM `$table` WHERE ID=$id");
    if(mysql_num_rows($query) > 0)
    {
        while($row = mysql_fetch_array( $query))
        {

?> 

<?php 
if($database=="diocese of colombo")
{
require_once('Connections/doc.php');
}
else if($database=="diocese of kurunagala")
{
require_once('Connections/dok.php');
}

 ?>

<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

  $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

  switch ($theType) {
    case "text":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;    
    case "long":
    case "int":
      $theValue = ($theValue != "") ? intval($theValue) : "NULL";
      break;
    case "double":
      $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
      break;
    case "date":
      $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
      break;
    case "defined":
      $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
      break;
  }
  return $theValue;
}
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "fundedit")) {
  $updateSQL = sprintf("UPDATE cdf SET Donor_of_Trust_Fund=%s, Fund_Name=%s, Type_of_Investment=%s, Original_Amount=%s, Other_Beneficiaries=%s, Source_of_Fund=%s, Deed_Number=%s, Legal_court_document_1=%s, Legal_court_document_2=%s, Legal_court_document_3=%s, Legal_court_document_4=%s, Legal_court_document_5=%s, Income_added_to_capital=%s, Beneficiary=%s, For_:_If_Any_01=%s, History_/_Remarks=%s, Doc_2_:_Minute=%s, Doc_2_:_BD=%s, Doc_2_:_SC=%s, Doc_2_:_CC=%s, Doc_3_:_Minute=%s, Doc_3_:_BD=%s, Doc_3_:_SC=%s, Doc_3_:_CC=%s, File_ID=%s, Doc_4_:_Minute=%s, Doc_4_:_BD=%s, Doc_4_:_SC=%s, Doc_4_:_CC=%s, Doc_5_:_Minute=%s, Doc_5_:_SC=%s, Doc_5_:_CC=%s, Doc_5_:_BD=%s WHERE ID=%s",
                       GetSQLValueString($_POST['Donor_of_Trust_Fund'], "text"),
                       GetSQLValueString($_POST['Fund_Name'], "text"),
                       GetSQLValueString($_POST['Type_of_Investment'], "text"),
                       GetSQLValueString($_POST['Original_Amount'], "double"),
                       GetSQLValueString($_POST['Other_Beneficiaries'], "text"),
                       GetSQLValueString($_POST['Source_of_Fund'], "text"),
                       GetSQLValueString($_POST['Deed_Number'], "text"),
                       GetSQLValueString($_POST['Legal_court_document_1'], "text"),
                       GetSQLValueString($_POST['Legal_court_document_2'], "text"),
                       GetSQLValueString($_POST['Legal_court_document_3'], "text"),
                       GetSQLValueString($_POST['Legal_court_document_4'], "text"),
                       GetSQLValueString($_POST['Legal_court_document_5'], "text"),
                       GetSQLValueString($_POST['Income_added_to_capital'], "text"),
                       GetSQLValueString($_POST['Beneficiary'], "text"),
                       GetSQLValueString($_POST['For_:_If_Any_01'], "text"),
                       GetSQLValueString($_POST['History_Remarks'], "text"),
                       GetSQLValueString(isset($_POST['Doc_2_:_Minute']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_2_:_BD']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_2_:_SC']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_2_:_CC']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_3_:_Minute']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_3_:_BD']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_3_:_SC']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_3_:_CC']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString($_POST['File_ID'], "text"),
                       GetSQLValueString(isset($_POST['Doc_4_:_Minute']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_4_:_BD']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_4_:_SC']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_4_:_CC']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_5_:_Minute']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_5_:_SC']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_5_:_CC']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_5_:_BD']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString($_POST['id'], "int"));

  mysql_select_db($db, $doc);
  $Result1 = mysql_query($updateSQL, $doc) or die(mysql_error());
}

if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "fundedit")) {
  $updateSQL = sprintf("UPDATE `$table` SET Donor_of_Trust_Fund=%s, Fund_Name=%s, Type_of_Investment=%s, Original_Amount=%s, Other_Beneficiaries=%s, Source_of_Fund=%s, Deed_Number=%s, Legal_court_document_1=%s, Legal_court_document_2=%s, Legal_court_document_3=%s, Legal_court_document_4=%s, Legal_court_document_5=%s, Income_added_to_capital=%s, Beneficiary=%s, For_:_Church_Maintenance=%s, For_:_Clergy_Stipend=%s, For_:_Sunday_School_Work=%s, For_:_Evangelis_Work=%s, For_:_Assisting_the_Poor=%s, For_:_If_Any_01=%s, For_:_If_Any_02=%s, History_/_Remarks=%s, Doc_1_:_Minute=%s, Doc_1_:_Bishops_Decision=%s, Doc_1_:_S_C=%s, Doc_1_:_CC=%s, Doc_2_:_Minute=%s, Doc_2_:_BD=%s, Doc_2_:_SC=%s, Doc_2_:_CC=%s, Doc_3_:_Minute=%s, Doc_3_:_BD=%s, Doc_3_:_SC=%s, Doc_3_:_CC=%s, File_ID=%s, Doc_4_:_Minute=%s, Doc_4_:_BD=%s, Doc_4_:_SC=%s, Doc_4_:_CC=%s, Doc_5_:_Minute=%s, Doc_5_:_SC=%s, Doc_5_:_CC=%s, Doc_5_:_BD=%s WHERE ID=%s",
                       GetSQLValueString($_POST['Donor_of_Trust_Fund'], "text"),
                       GetSQLValueString($_POST['Fund_Name'], "text"),
                       GetSQLValueString($_POST['Type_of_Investment'], "text"),
                       GetSQLValueString($_POST['Original_Amount'], "double"),
                       GetSQLValueString($_POST['Other_Beneficiaries'], "text"),
                       GetSQLValueString($_POST['Source_of_Fund'], "text"),
                       GetSQLValueString($_POST['Deed_Number'], "text"),
                       GetSQLValueString($_POST['Legal_court_document_1'], "text"),
                       GetSQLValueString($_POST['Legal_court_document_2'], "text"),
                       GetSQLValueString($_POST['Legal_court_document_3'], "text"),
                       GetSQLValueString($_POST['Legal_court_document_4'], "text"),
                       GetSQLValueString($_POST['Legal_court_document_5'], "text"),
                       GetSQLValueString($_POST['Income_added_to_capital'], "text"),
                       GetSQLValueString($_POST['Beneficiary'], "text"),
                       GetSQLValueString(isset($_POST['CM']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['cs']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['ssw']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['ew']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['ap']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString($_POST['For_:_If_Any_01'], "text"),
                       GetSQLValueString($_POST['HistorFor_:_If_Any_02'], "text"),
                       GetSQLValueString($_POST['History_/_Remarks'], "text"),
                       GetSQLValueString(isset($_POST['minute']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['doc1bd']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['doc1sc']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['doc1cc']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_2_:_Minute']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_2_:_BD']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_2_:_SC']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_2_:_CC']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_3_:_Minute']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_3_:_BD']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_3_:_SC']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_3_:_CC']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString($_POST['File_ID'], "text"),
                       GetSQLValueString(isset($_POST['Doc_4_:_Minute']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_4_:_BD']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_4_:_SC']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_4_:_CC']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_5_:_Minute']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_5_:_SC']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_5_:_CC']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString(isset($_POST['Doc_5_:_BD']) ? "true" : "", "defined","1","0"),
                       GetSQLValueString($_POST['id'], "int"));
$doc=$_GET['cat'];
  mysql_select_db($db, $doc);

  $Result1 = mysql_query($updateSQL, $doc) or die(mysql_error());

  $updateGoTo = "?result=added";
  if (isset($_SERVER['QUERY_STRING'])) {
    $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
    $updateGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $updateGoTo));
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style type="text/css">
<!--
body {
    background-color: #CEECF7;
}
</style><?php
// Retreving data from URL
if(!empty($_GET['id']))
{
$id=$_GET['id']; // ID of a fund
$database=$_GET['db']; // Database
$table=$_GET['cat']; // Category or Table

// Building a Database connection
$host="localhost"; // host
$user="root"; // User Name
$pass=""; // Password
$db=$_GET['db']; // Database. Database retreving from URL
$database=strtolower($db); //lowercasing all letters
$table=$_GET['cat']; // Database Table. Data retreving from URL

$connect=mysql_connect($host,$user,$pass)or die("<b>Unable to start a connection with database.</b> <br>Please contact your Web Administrator");
mysql_select_db($database,$connect)or die("<b>Unable to catch the database</b><br> Please contact your Web Administrator");
}

$query=mysql_query("SELECT * FROM `$table` WHERE ID=$id");
    if(mysql_num_rows($query) > 0)
    {
        while($row = mysql_fetch_array( $query))
        {

?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Fund Editor &gt;&gt; <?php echo $row['Fund_Name'];?> </title>
<link href="Style/default.css" rel="stylesheet" type="text/css" />
<script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
<link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />

<style type="text/css">
<!--
.style7 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: bold; }
.style10 {font-size: 14px; font-family: Arial, Helvetica, sans-serif;}
.style11 {font-family: Arial, Helvetica, sans-serif}
.style12 {font-size: 12px}
.style14 {color: #000000}
-->
</style>
</head>

<body>

<table width="1024" border="0" align="center" cellspacing="0" class="mainfr">
  <tr>
    <td><table width="1021" border="0" cellspacing="0">
      <tr>
        <td width="8">&nbsp;</td>
        <td width="36">&nbsp;</td>
        <td width="485">Fund Editor</td>
        <td width="486">&nbsp;</td>
      </tr>
    </table>
      <form id="fundedit" name="fundedit" method="POST">
        <table width="900" border="0" align="center" cellspacing="0" class="fundbgtable">
          <tr>
            <td><p>&nbsp;</p>
                <table width="800" border="0" align="center" cellspacing="0">
                  <tr>
                    <td>&nbsp;</td>
                    <td bgcolor="#FFFFFF" class="fundfields"><span class="style10">Fund ID</span></td>
                    <td bgcolor="#FFFFFF" class="fundfields2"><?php  echo $row['ID']; ?><input type="hidden" name="id" value="<?php  echo $row['ID']; ?>" /></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td class="fundfields">&nbsp;</td>
                    <td class="fundfields2">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td bgcolor="#FFFFFF" class="fundfields style14">File ID</td>
                    <td bgcolor="#FFFFFF" class="fundfields2"><span class="style7">
                      <input name="File_ID" type="text" value="<?php  echo $row['File_ID']; ?>" size="50" />
                    </span></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td class="fundfields">&nbsp;</td>
                    <td class="fundfields2">&nbsp;</td>
                  </tr>
                  <tr>
                    <td width="8">&nbsp;</td>
                    <td width="148" bgcolor="#FFFFFF" class="fundfields"><span class="style10">Fund Name</span></td>
                    <td width="638" bgcolor="#FFFFFF" class="fundfields2"><span class="style7">
                      <input name="Fund_Name" type="text" value="<?php  echo $row['Fund_Name']; ?>" size="50" />
                    </span></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td bgcolor="#DDF9F9" class="fundfields">&nbsp;</td>
                    <td bgcolor="#DDF9F9" class="fundfields2">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td bgcolor="#FFFFFF" class="fundfields"><span class="style10">Donor of Trust Fund</span></td>
                    <td bgcolor="#FFFFFF" class="fundfields2"><span class="style7">
                      <input name="Donor_of_Trust_Fund" type="text" value="<?php  echo $row['Donor_of_Trust_Fund']; ?>" size="50" />
                    </span></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td bgcolor="#DDF9F9" class="fundfields">&nbsp;</td>
                    <td bgcolor="#DDF9F9" class="fundfields2">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td bgcolor="#FFFFFF" class="fundfields"><span class="style10">Type of Investment</span></td>
                    <td bgcolor="#FFFFFF" class="fundfields2"><label>
                      <select name="Type_of_Investment" id="Type_of_Investment">
                        <option selected="selected">None..</option>
                        <option value="Cash" <?php $cash=$row['Type_of_Investment'];
                                                if($cash== "Cash"){
                                                echo "selected";}?>>Cash (Pool)</option>
                        <option value="Shares"<?php $shares=$row['Type_of_Investment'];
                                                if($shares== "Shares"){
                                                echo "selected";}?> >Shares</option>
                        <option value="FD" <?php $fd=$row['Type_of_Investment'];
                                                if($fd== "FD"){
                                                echo "selected";}?>>Fixed Deposits</option>
                        <option value="Property" <?php $fd=$row['Type_of_Investment'];
                                                if($fd== "Property"){
                                                echo "selected";}?>>Property</option>
                        <option value="TB" <?php $fd=$row['Type_of_Investment'];
                                                if($fd== "TB"){
                                                echo "selected";}?>>Treasury Bills</option>
                        <option value="PnS" <?php $fd=$row['Type_of_Investment'];
                                                if($fd== "PnS"){
                                                echo "selected";}?>>Pool and Shares</option>
                        <option value="PnFD" <?php $fd=$row['Type_of_Investment'];
                                                if($fd== "PnFD"){
                                                echo "selected";}?>>Pool and Fixed Deposits</option>
                      </select>
                    </label></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td bgcolor="#DDF9F9" class="fundfields">&nbsp;</td>
                    <td bgcolor="#DDF9F9" class="fundfields2">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td bgcolor="#FFFFFF" class="fundfields"><span class="style10">Original Amount</span></td>
                    <td bgcolor="#FFFFFF" class="fundfields2"><span class="style7">
                      <input name="Original_Amount" type="text" value="<?php  echo $row['Original_Amount']; ?>" size="50" />
                    </span> </td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td bgcolor="#DDF9F9" class="fundfields">&nbsp;</td>
                    <td bgcolor="#DDF9F9" class="fundfields2">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td bgcolor="#FFFFFF" class="fundfields">Beneficiary</td>
                    <td bgcolor="#FFFFFF" class="fundfields2"><span class="style7">
                      <input name="Beneficiary" type="text" id="Beneficiary" value="<?php  echo $row['Beneficiary']; ?>" size="50" />
                    </span></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td bgcolor="#DDF9F9" class="fundfields">&nbsp;</td>
                    <td bgcolor="#DDF9F9" class="fundfields2">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td bgcolor="#FFFFFF" class="fundfields"><span class="style10">Other Beneficiaries</span></td>
                    <td bgcolor="#FFFFFF" class="fundfields2"><span class="style7">
                      <input name="Other_Beneficiaries" type="text" value="<?php  echo $row['Other_Beneficiaries']; ?>" size="50" />
                    </span></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td bgcolor="#DDF9F9" class="fundfields">&nbsp;</td>
                    <td bgcolor="#DDF9F9" class="fundfields2">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td bgcolor="#FFFFFF" class="fundfields">Income</td>
                    <td bgcolor="#FFFFFF" class="fundfields2"><span class="style7">
                      <input name="Income_added_to_capital" type="text" id="Income_added_to_capital" value="<?php  echo $row['Income_added_to_capital']; ?>" size="50" />
                    </span></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td bgcolor="#DDF9F9" class="fundfields">&nbsp;</td>
                    <td bgcolor="#DDF9F9" class="fundfields2">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td bgcolor="#FFFFFF" class="fundfields"><span class="style10">Source of Fund</span></td>
                    <td bgcolor="#FFFFFF" class="fundfields2"><span class="style7">
                      <input name="Source_of_Fund" type="text" value="<?php  echo $row['Source_of_Fund']; ?>" size="50" />
                    </span></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td bgcolor="#DDF9F9" class="fundfields">&nbsp;</td>
                    <td bgcolor="#DDF9F9" class="fundfields2">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td bgcolor="#FFFFFF" class="fundfields"><span class="style10">Deed Number<br />
                    </span></td>
                    <td bgcolor="#FFFFFF" class="fundfields2"><span class="style7"><?php echo $row['Deed_Number']; ?>
                          <input name="Deed_Number" type="text" value="<?php  echo $row['Deed_Number']; ?>" size="50" />
                    </span></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td bgcolor="#DDF9F9" class="fundfields">&nbsp;</td>
                    <td bgcolor="#DDF9F9" class="fundfields2">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td bgcolor="#FFFFFF" class="fundfields">History / Remarks</td>
                    <td bgcolor="#FFFFFF" class="fundfields2"><label>
                      <input name="History_Remarks" type="text" value="<?php  echo $row['History_/_Remarks']; ?>" size="50" />
                    </label></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td bgcolor="#DDF9F9" class="fundfields">&nbsp;</td>
                    <td bgcolor="#DDF9F9" class="fundfields2">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td bgcolor="#FFFFFF" class="fundfields">Purpose(s)</td>
                    <td bgcolor="#FFFFFF" class="fundfields2"><label>
                      <input type="checkbox" name="CM" id="CM" 
              <?php $cm=$row['For_:_Church_Maintenance']; 
              if($cm == "1"){
              echo "checked"; } ?> />
                      Church Maintainance |
                      <input type="checkbox" name="cs" id="cs" 
              <?php $cs=$row['For_:_Clergy_Stipend']; 
              if($cs == "1"){
              echo "checked"; } ?>/>
                      Clergy Stipend |
                      <input type="checkbox" name="ssw" id="ssw" 
              <?php $ssw=$row['For_:_Sunday_School_Work']; 
              if($ssw == "1"){
              echo "checked"; } ?> />
                      Sunday School Work |
                      <input type="checkbox" name="ew" id="ew" 
              <?php $ew=$row['For_:_Evangelis_Work']; 
              if($ew == "1"){
              echo "checked"; } ?> />
                      Evangelist |
                      <input type="checkbox" name="ap" id="ap" 
              <?php $ew=$row['For_:_Assisting_the_Poor']; 
              if($ew == "1"){
              echo "checked"; } ?>/>
                      Assisting Poor</label></td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td bgcolor="#FFFFFF">&nbsp;</td>
                    <td bgcolor="#FFFFFF" class="fundfields2"> If any 01 :
                      <label class="warning">
                        <input name="For_:_If_Any_01" type="text" id="For_:_If_Any_01" value="<?php  echo $row['For_:_If_Any_01']; ?>" size="30" />
                      </label>
                      | If any 02 :
                      <label class="warning">
                        <input name="HistorFor_:_If_Any_02" type="text" id="HistorFor_:_If_Any_02" value="<?php  echo $row['For_:_If_Any_02']; ?>" size="30" />
                        <?php echo $row['For_:_If_Any_02']?></label></td>
                  </tr>
                </table>
              <p>&nbsp;</p>


              </label>
                <table width="609" border="0" align="center" cellspacing="0">
      <tr>
        <td width="607"><div id="TabbedPanels1" class="TabbedPanels">
          <ul class="TabbedPanelsTabGroup">
            <li class="TabbedPanelsTab" tabindex="0">Legal Court Document 01</li>
            <li class="TabbedPanelsTab" tabindex="0">02</li>
            <li class="TabbedPanelsTab" tabindex="0">03</li>
            <li class="TabbedPanelsTab" tabindex="0">04</li>
            <li class="TabbedPanelsTab" tabindex="0">05</li>
          </ul>
          <div class="TabbedPanelsContentGroup">
            <div class="style12 style11 TabbedPanelsContent"><strong>
              <label>
              <input type="checkbox" name="minute" id="minute"  
              <?php $doc1minute=$row['Doc_1_:_Minute']; 
              if($doc1minute == "1"){
              echo "checked"; } ?>  />
              </label>
              Minute 
              <label>
              <input type="checkbox" name="doc1bd" id="doc1bd"   
              <?php $doc1bd=$row['Doc_1_:_Bishops_Decision']; 
              if($doc1bd == "1"){
              echo "checked"; } ?> />
              </label>
              Bishops Decision 
              <label>
              <input type="checkbox" name="doc1sc" id="doc1sc"  
              <?php $doc1sc=$row['Doc_1_:_S_C']; 
              if($doc1sc== "1"){
              echo "checked"; } ?>/>
              </label>
              Standing Committee 
              <label>
              <input type="checkbox" name="doc1cc" id="doc1cc"  
              <?php $doc1cc=$row['Doc_1_:_CC']; 
              if($doc1cc== "1"){
              echo "checked"; } ?> />
              </label>
              Court Case | Document Number</strong> : <input name="Legal_court_document_1" type="text" id="Legal_court_document_1" value="<?php echo $row['Legal_/_Court_Document_1']; ?>" size="2" /> 
              </div>
            <div class="TabbedPanelsContent"><strong>
              <label>
              <input type="checkbox" name="Doc_2_:_Minute" id="minute"  
              <?php $doc2minute=$row['Doc_2_:_Minute']; 
              if($doc2minute == "1"){
              echo "checked"; } ?>  />
              </label>
            </strong><span class="style12 style11"><strong>Minute 
              <label>
              <input type="checkbox" name="Doc_2_:_BD" id="doc1bd"   
              <?php $doc2bd=$row['Doc_2_:_BD']; 
              if($doc2bd == "1"){
              echo "checked"; } ?> />
              </label>
              Bishops Decision 
              <label>
              <input type="checkbox" name="Doc_2_:_SC" id="doc1sc"  
              <?php $doc2sc=$row['Doc_2_:_SC']; 
              if($doc2sc== "1"){
              echo "checked"; } ?>/>
              </label>
              Standing Committee 
              <label>
              <input type="checkbox" name="Doc_2_:_CC" id="doc1cc"  
              <?php $doc2cc=$row['Doc_2_:_CC']; 
              if($doc2cc== "1"){
              echo "checked"; } ?> />
              </label>
              Court Case | Document Number :
              <input name="Legal_court_document_2" type="text" value="<?php echo $row['Legal_/_Court_Document_2']; ?>" size="2" />
              </strong></span></div>
            <div class="TabbedPanelsContent"><strong>
              <label>
              <input type="checkbox" name="Doc_3_:_Minute" id="minute"  
              <?php $doc3minute=$row['Doc_3_:_Minute']; 
              if($doc3minute == "1"){
              echo "checked"; } ?>  />
              </label>
            </strong><span class="style12 style11"><strong>Minute 
              <label>
              <input type="checkbox" name="Doc_3_:_BD" id="doc1bd"   
              <?php $doc3bd=$row['Doc_3_:_BD']; 
              if($doc3bd == "1"){
              echo "checked"; } ?> />
              </label>
              Bishops Decision 
              <label>
              <input type="checkbox" name="Doc_3_:_SC" id="doc1sc"  
              <?php $doc3sc=$row['Doc_3_:_SC']; 
              if($doc3sc== "1"){
              echo "checked"; } ?>/>
              </label>
              Standing Committee 
              <label>
              <input type="checkbox" name="Doc_3_:_CC" id="doc1cc"  
              <?php $doc3cc=$row['Doc_3_:_CC']; 
              if($doc3cc== "1"){
              echo "checked"; } ?> />
              </label>
              Court Case | Document Number :<input name="Legal_court_document_3" type="text" id="Legal_court_document_3" value="<?php echo $row['Legal_/_Court_Document_3']; ?>" size="2" />
              </strong></span></div>
            <div class="TabbedPanelsContent"><strong>
              <label>
              <input type="checkbox" name="Doc_4_:_Minute" id="doc4minute"  
              <?php $doc4minute=$row['Doc_4_:_Minute']; 
              if($doc4minute == "1"){
              echo "checked"; } ?>  />
              </label>
            </strong><span class="style12 style11"><strong>Minute 
              <label>
              <input type="checkbox" name="Doc_4_:_BD" id="doc4bd"   
              <?php $doc4bd=$row['Doc_4_:_BD']; 
              if($doc4bd == "1"){
              echo "checked"; } ?> />
              </label>
              Bishops Decision 
              <label>
              <input type="checkbox" name="Doc_4_:_SC" id="doc4sc"  
              <?php $doc4sc=$row['Doc_4_:_SC']; 
              if($doc4sc== "1"){
              echo "checked"; } ?>/>
              </label>
              Standing Committee 
              <label>
              <input type="checkbox" name="Doc_4_:_CC" id="doc4cc"  
              <?php $doc4cc=$row['Doc_4_:_CC']; 
              if($doc4cc== "1"){
              echo "checked"; } ?> />
              </label>
              Court Case | Document Number :
              <input name="Legal_court_document_4" type="text" id="Legal_court_document_4" value="<?php echo $row['Legal_/_Court_Document_4']; ?>" size="2" />
              </strong></span></div>
            <div class="TabbedPanelsContent"><strong>
              <label>
              <input type="checkbox" name="Doc_5_:_Minute" id="doc5minute"  
              <?php $doc5minute=$row['Doc_5_:_Minute']; 
              if($doc5minute == "1"){
              echo "checked"; } ?>  />
              </label>
            </strong><span class="style12 style11"><strong>Minute 
              <label>
              <input type="checkbox" name="Doc_5_:_BD" id="doc5bd"   
              <?php $doc5bd=$row['Doc_5_:_BD']; 
              if($doc5bd == "1"){
              echo "checked"; } ?> />
              </label>
              Bishops Decision 
              <label>
              <input type="checkbox" name="Doc_5_:_SC" id="doc5sc"  
              <?php $doc5sc=$row['Doc_5_:_SC']; 
              if($doc5sc== "1"){
              echo "checked"; } ?>/>
              </label>
              Standing Committee 
              <label>
              <input type="checkbox" name="Doc_5_:_CC" id="doc5cc"  
              <?php $doc5cc=$row['Doc_5_:_CC']; 
              if($doc5cc== "1"){
              echo "checked"; } ?> />
              </label>
              Court Case | Document Number :
              <input name="Legal_court_document_5" type="text" id="Legal_court_document_5" value="<?php echo $row['Legal_/_Court_Document_5']; ?>" size="2" />
              </strong></span></div></div>
          </div>
        </div></td>
      </tr>
    </table><p align="center">
      <label>
      <input type="submit" name="Update" id="Update" value="Update" />
      </label>
    </p></td>
          </tr>
        </table>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <input type="hidden" name="MM_update" value="fundedit" />
      </form>
      <p>&nbsp;</p>

    <p>&nbsp;</p>
    <p>&nbsp;</p></td>
  </tr>
</table> 
<?php


}}}}?>
<script type="text/javascript">
<!--
var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1");
//-->
</script>
</body>
</html>
0

Table Sctucture

Table structure for table cdf

CREATE TABLE IF NOT EXISTS cdf (
Donor_of_Trust_Fund varchar(255) DEFAULT NULL,
ID int(11) NOT NULL,
Fund_Name varchar(255) DEFAULT NULL,
Type_of_Investment varchar(255) DEFAULT NULL,
Original_Amount decimal(19,4) DEFAULT NULL,
Other_Beneficiaries longtext,
Source_of_Fund varchar(255) DEFAULT NULL,
Deed_Number varchar(255) DEFAULT NULL,
Legal_/_Court_Document_1 varchar(255) DEFAULT NULL,
Legal_/_Court_Document_2 varchar(255) DEFAULT NULL,
Legal_/_Court_Document_3 varchar(255) DEFAULT NULL,
Legal_/_Court_Document_4 varchar(255) DEFAULT NULL,
Legal_/_Court_Document_5 varchar(255) DEFAULT NULL,
Income_added_to_capital longtext,
Beneficiary varchar(255) DEFAULT NULL,
For_:_Church_Maintenance tinyint(4) DEFAULT NULL,
For_:_Clergy_Stipend tinyint(4) DEFAULT NULL,
For_:_Sunday_School_Work tinyint(4) DEFAULT NULL,
For_:_Evangelis_Work tinyint(4) DEFAULT NULL,
For_:_Assisting_the_Poor tinyint(4) DEFAULT NULL,
For_:_If_Any_01 varchar(255) DEFAULT NULL,
For_:_If_Any_02 varchar(255) DEFAULT NULL,
Deed_Date datetime DEFAULT NULL,
History_/_Remarks longtext,
Doc_1_:_Minute tinyint(4) DEFAULT NULL,
Doc_1_:_Bishops_Decision tinyint(4) DEFAULT NULL,
Doc_1_:_S_C tinyint(4) DEFAULT NULL,
Doc_1_:_CC tinyint(4) DEFAULT NULL,
Doc_2_:_Minute tinyint(4) DEFAULT NULL,
Doc_2_:_BD tinyint(4) DEFAULT NULL,
Doc_2_:_SC tinyint(4) DEFAULT NULL,
Doc_2_:_CC tinyint(4) DEFAULT NULL,
Doc_3_:_Minute tinyint(4) DEFAULT NULL,
Doc_3_:_BD tinyint(4) DEFAULT NULL,
Doc_3_:_SC tinyint(4) DEFAULT NULL,
Doc_3_:_CC tinyint(4) DEFAULT NULL,
File_ID varchar(255) DEFAULT NULL,
Doc_4_:_Minute tinyint(4) DEFAULT NULL,
Doc_4_:_BD tinyint(4) DEFAULT NULL,
Doc_4_:_SC tinyint(4) DEFAULT NULL,
Doc_4_:_CC tinyint(4) DEFAULT NULL,
Doc_5_:_Minute tinyint(4) DEFAULT NULL,
Doc_5_:_SC tinyint(4) DEFAULT NULL,
Doc_5_:_CC tinyint(4) DEFAULT NULL,
Doc_5_:_BD tinyint(4) DEFAULT NULL,
PRIMARY KEY (ID)
)

0

Why dont you first store your values in variables like this;

$Donor_of_Trust_Fund = GetSQLValueString($_POST['Donor_of_Trust_Fund']);

so that your code is less crowded.

0

Why dont you first store your values in variables like this;

Its not a my coding dear,
Its automatically generated when I using Dreamweaver

0

Ok, and then also remove the semicolons from the table rows, e.g instead of;
Doc_4_:_SC

Make it;
Doc_4_SC

0

an

Ok, and then also remove the semicolons from the table rows, e.g instead of;
Doc_4_:_SC

Make it;
Doc_4_SC

Ok my dear friend,
thanks a lot..
I ll correct these errors and update you about the situation

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.