List:General Discussion« Previous MessageNext Message »
From:Stuart Felenstein Date:August 18 2004 8:25pm
Subject:RE: Strange Text Field
View as plain text  
Okay, still not working in this one table so here is
all my info:  I've also attached the table dump.

Thank you ,
Stuart

Error Code from attempted transaction:
-------------------------------------------------
Transaction failed!
Your SQL:
insert into LFWBank
(JobReferenceCode,VendorID,LocationCity,LocationState,AreaCode,PayRate,Contact,Contact
Email,TravelReq,FullSpec) values
(9999,11,'Bronx','AL',212,11,'Joe','Joe@stripped','no','
)
Error Msg:
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 'Email,TravelReq,FullSpec)
values (9999,11,'Bronx','AL',212,11,'
---------------------------------------------------
My Code:
<?php
//Connection statement
require_once('Connections/MYSQLWH.php');

//Aditional Functions
require_once('includes/functions.inc.php');

//load the tNG classes
require_once('tNG/KT_tNG.inc.php');

//KTML include files
require_once('ktml2/includes/ktedit/activex.php');

//start trigger UniVal1
//remove this line if you want to edit  the code by
hand
function KT_TriggerBEFORE_UniVal1(&$tNG) {
  $colNames =
Array(('JobReferenceCode'),('VendorID'),('LocationCity'),('LocationState'),('AreaCode'),('PayRate'),('Contact'),('Contact
Email'),('TravelReq'),('FullSpec'));
  $required =
Array((true),(false),(true),(false),(false),(false),(false),(false),(false),(true));
  $regExp =
Array(('(.|\n)*'),('(.|\n)*'),('(.|\n)*'),('(.|\n)*'),('-{0,1}\d+'),('(.|\n)*'),('(.|\n)*'),('(.|\n)*'),('(.|\n)*'),('(.|\n)*'));
  $labels = Array(('The value of the field
\'JobReferenceCode\' is incorrect!'),('The value of
the field \'VendorID\' is incorrect!'),('The value of
the field \'LocationCity\' is incorrect!'),('The value
of the field \'LocationState\' is incorrect!'),('The
value of the field \'AreaCode\' is incorrect!'),('The
value of the field \'PayRate\' is incorrect!'),('The
value of the field \'Contact\' is incorrect!'),('The
value of the field \'Contact Email\' is
incorrect!'),('The value of the field \'TravelReq\' is
incorrect!'),('The value of the field \'FullSpec\' is
incorrect!'));
  $uniVal = new UniValValidator($labels, $required,
$regExp, $tNG->nameToValue, $colNames);
  if (($err = $uniVal->validateFields()) != "") {
    $tNG->setError(-1,$err);
  }
}
//end trigger UniVal1

//start trigger RollBack1
//remove this line if you want to edit  the code by
hand
function KT_TriggerERROR_RollBack1(&$tNG) {
  $keyQuote = $tNG->type2quote[NUMERIC_TYPE];
  $sql = "delete from " . $tNG->getTable() . " where
JobID = " . $keyQuote . $tNG->getRecordId() .
$keyQuote;
  $tNG->connection->Execute($sql);
}
//end trigger RollBack1

// make an instance of the transaction object
$JobPostin = new KT_tNG();
// register to a connection
$JobPostin->setConnection($MYSQLWH);

// register the UniVal1 trigger
$JobPostin->registerTrigger(BEFORE,'KT_TriggerBEFORE_UniVal1',1);

// register the RollBack1 trigger
$JobPostin->registerTrigger(ERROR,'KT_TriggerERROR_RollBack1',0);

//set the STARTER condition
$JobPostin->registerTrigger(STARTER,'KT_TriggerSTARTER_Default',1,(isset($HTTP_POST_VARS['MM_insert'])
? $HTTP_POST_VARS['MM_insert'] : null));
$JobPostin->registerTrigger(ERROR,"KT_TriggerERROR_ProduceFakeRs",1);
// set the autogeneration information
$JobPostin->setTransactionType(INSERT_TYPE);
$JobPostin->setTable('LFWJobBank');
$JobPostin->setColumnsName(Array(('JobReferenceCode'),('VendorID'),('LocationCity'),('LocationState'),('AreaCode'),('PayRate'),('Contact'),('Contact
Email'),('TravelReq'),('FullSpec')));
$JobPostin->setColumnsType(Array((NUMERIC_TYPE),(NUMERIC_TYPE),(STRING_TYPE),(STRING_TYPE),(NUMERIC_TYPE),(NUMERIC_TYPE),(STRING_TYPE),(STRING_TYPE),(STRING_TYPE),(STRING_TYPE)));
$JobPostin->setColumnsValue(Array(((isset($HTTP_POST_VARS['JobReferenceCode'])
? $HTTP_POST_VARS['JobReferenceCode'] :
null)),((isset($HTTP_POST_VARS['VendorID']) ?
$HTTP_POST_VARS['VendorID'] :
null)),((isset($HTTP_POST_VARS['LocationCity']) ?
$HTTP_POST_VARS['LocationCity'] :
null)),((isset($HTTP_POST_VARS['LocationState']) ?
$HTTP_POST_VARS['LocationState'] :
null)),((isset($HTTP_POST_VARS['AreaCode']) ?
$HTTP_POST_VARS['AreaCode'] :
null)),((isset($HTTP_POST_VARS['PayRate']) ?
$HTTP_POST_VARS['PayRate'] :
null)),((isset($HTTP_POST_VARS['Contact']) ?
$HTTP_POST_VARS['Contact'] :
null)),((isset($HTTP_POST_VARS['Contact_Email']) ?
$HTTP_POST_VARS['Contact_Email'] :
null)),((isset($HTTP_POST_VARS['TravelReq']) ?
$HTTP_POST_VARS['TravelReq'] :
null)),((isset($HTTP_POST_VARS['FullSpec']) ?
$HTTP_POST_VARS['FullSpec'] : null))));

// execute the transaction
$JobPostin->executeTransaction();

// begin Recordset
$query_rsStates = "SELECT USStates.States FROM
USStates";
$rsStates = $MYSQLWH->SelectLimit($query_rsStates) or
die($MYSQLWH->ErrorMsg());
$totalRows_rsStates = $rsStates->RecordCount();
// end Recordset

// default values for transaction JobPostin
if (!isset($KT_fakeRs)) {
  $KT_fakeRs = new fakeRecordSet();
  $KT_fakeRs->PrepareValue('JobReferenceCode', "");
  $KT_fakeRs->PrepareValue('VendorID', "");
  $KT_fakeRs->PrepareValue('LocationCity', "");
  $KT_fakeRs->PrepareValue('LocationState', "");
  $KT_fakeRs->PrepareValue('AreaCode', "");
  $KT_fakeRs->PrepareValue('PayRate', "");
  $KT_fakeRs->PrepareValue('Contact', "");
  $KT_fakeRs->PrepareValue('Contact Email', "");
  $KT_fakeRs->PrepareValue('TravelReq', "");
  $KT_fakeRs->PrepareValue('FullSpec', "");
}
// end default values for transaction JobPostin

//PHP ADODB document - made with PHAkt 2.7.3?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN"><html>
<head>
<title>icanctv</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<link href="text.css" rel="stylesheet"
type="text/css">
<style type="text/css">
<!--
.style11 {
	font-size: 18px;
	color: #FFFFFF;
}
.style15 {color: #FFFFFF; font-weight: bold; }
.style18 {font-size: 18px; color: #003366; }
.style19 {
	color: #FFFFFF;
	font-weight: bold;
	font-size: 16px;
}
.style20 {
	color: #FFFFFF;
	font-size: 16px;
}
.style21 {color: #FFFFFF}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window
if Nav4 resized
  if (init==true) with (navigator) {if
((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth;
document.MM_pgH=innerHeight; onresize=MM_reloadPage;
}}
  else if (innerWidth!=document.MM_pgW ||
innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>

</head>

<body bgcolor="484848" background="images/bg.gif">
<table width="175" border="1" align="left"
cellpadding="10" cellspacing="0"
bordercolor="#FFFFFF">
  <tr>
    <td align="center" valign="top"
bgcolor="#000000"><img
src="images/controlPanelButton.gif" width="150"
height="50" align="top"></td>
  </tr>
  <tr>
    <td bgcolor="#000000">&nbsp;</td>
  </tr>
  <tr>
    <td bgcolor="#000000">&nbsp;</td>
  </tr>
  <tr>
    <td bgcolor="#000000">&nbsp;</td>
  </tr>
</table>
<table width="764" border="1" align="left"
cellpadding="0" cellspacing="1" bordercolor="#FFFFFF"
bgcolor="#FFFFFF">
  <!--DWLayoutTable-->
  <tr valign="top" bgcolor="#000066">
    <td height="30" colspan="2"><img
src="images/NewBannerforLostPswd.gif" width="700"
height="50"></td>
  </tr>
  <tr valign="top" bgcolor="#000066">
    <td height="30"
colspan="2"><!--DWLayoutEmptyCell-->&nbsp;</td>
  </tr>
  <tr valign="top" bgcolor="#666666"> 
    <td height="30" colspan="2"><div align="center"
class="style18">
      <p class="style20">Before you set off to lurk
around, please take the time to fill out this
registration form. Once submitted you will receive an
email with your username and password. </p>
    </div></td>
  </tr>
  <tr valign="middle" bgcolor="#999999">
    <td height="30" colspan="2"><div align="center"
class="style19">Required fields are marked with an
asterik (*) </div></td>
  </tr>
  <tr> 
    <td width="431" height="242" align="left"
valign="top" bgcolor="#0033FF"><p align="left"
class="style11"> </p>
      <p></p>
      
    
    
          <form method="post" name="form1" >
      <table width="626" height="366" align="center">
        <tr valign="baseline">
          <td align="right" nowrap>&nbsp;</td>
          <td width="9">&nbsp;</td>
          <td width="8">&nbsp;</td>
          <td width="41">&nbsp;</td>
          <td width="192">&nbsp;</td>
        </tr>
        <tr valign="baseline">
          <td width="154" align="right"
nowrap>Poster's Reference Code:</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td><input type="text"
name="JobReferenceCode" value="<?php echo
htmlentities($KT_fakeRs->Fields('JobReferenceCode'))?>"
size="32"></td>
        </tr>
        <tr valign="baseline">
          <td nowrap align="right">VendorID:</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td><input type="text" name="VendorID"
value="<?php echo
htmlentities($KT_fakeRs->Fields('VendorID'))?>"
size="32"></td>
        </tr>
        <tr valign="baseline">
          <td nowrap align="right">City:</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td><input type="text" name="LocationCity"
value="<?php echo
htmlentities($KT_fakeRs->Fields('LocationCity'))?>"
size="32"></td>
        </tr>
        <tr valign="baseline">
          <td nowrap align="right">State:</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td><select name="LocationState">
              <?php 
  while(!$rsStates->EOF){
?>
              <option value="<?php echo
$rsStates->Fields('States')?>" ><?php echo
$rsStates->Fields('States')?></option>
              <?php
    $rsStates->MoveNext();
  }
  $rsStates->MoveFirst();
?>
            </select>
          </td>
        <tr valign="baseline">
          <td nowrap align="right">Area Code:</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td><input type="text" name="AreaCode"
value="<?php echo
htmlentities($KT_fakeRs->Fields('AreaCode'))?>"
size="32"></td>
        </tr>
        <tr valign="baseline">
          <td nowrap align="right">PayRate:</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td><input type="text" name="PayRate"
value="<?php echo
htmlentities($KT_fakeRs->Fields('PayRate'))?>"
size="32"></td>
        </tr>
        <tr valign="baseline">
          <td nowrap align="right">Contact:</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td><input type="text" name="Contact"
value="<?php echo
htmlentities($KT_fakeRs->Fields('Contact'))?>"
size="32"></td>
        </tr>
        <tr valign="baseline">
          <td nowrap align="right">Contact Email:</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td><input type="text" name="Contact_Email"
value="<?php echo
htmlentities($KT_fakeRs->Fields('Contact_Email'))?>"
size="32"></td>
        </tr>
        <tr valign="baseline">
          <td nowrap align="right">Travel
Required:</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td><input type="text" name="TravelReq"
value="<?php echo
htmlentities($KT_fakeRs->Fields('TravelReq'))?>"
size="32"></td>
        </tr>
        <tr valign="baseline">
          <td align="right" nowrap>Job Specifics:</td>
          <td valign="baseline">&nbsp;</td>
          <td valign="baseline">&nbsp;</td>
          <td valign="baseline">&nbsp;</td>
          <td valign="baseline"><input type="hidden"
name="FullSpec" id="FullSpec" value="<?php echo
htmlentities($KT_fakeRs->Fields('FullSpec'))?>"
size="32">
              <?php 
   $KT_display = "Cut,Copy,Paste,Insert Image,Insert
Table,Toggle Vis/Invis,Toggle WYSIWYG,Find
Text,Bold,Italic,Underline,Align Left,Align
Center,Align Right,Align Justify,Background
Color,Foreground Color,Undo,Redo,Bullet List,Numbered
List,Indent,Outdent,HR,Font,Font Type,Font Size,Insert
Link";
   showActivex('FullSpec', 400, 400,
false,$KT_display, "ktml2/",
"ktml2/includes/css/KT_styles.css",
"../../../ktml2/images/uploads/",
"../../../ktml2/files/uploads/",1, "en", -1,
"english");
?></td>
          </tr>
        <tr valign="baseline">
          <td nowrap align="right">&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td><input type="submit" name="MM_insert"
value="Insert record"></td>
        </tr>
      </table>
    </form>
    <p>&nbsp;</p>
    <p>&nbsp;</p></td>
    <td height="192" valign="top"
bgcolor="9FA1A4"><?php  
  echo $JobPostin->getErrorMsg(); 
?>
      <?php
if ($JobPostin->getErrorNo()) {
?>
      <?php
} // end Display Error
?></td>
  </tr>
  <tr align="right" bgcolor="#000000"> 
    <td colspan="2">EditRegion9
      <table width="435" border="0" cellspacing="0"
cellpadding="10">
        <tr> 
          <td width="415" align="center"><font
color="#FFFFFF" size="1" face="Verdana, Arial,
Helvetica, sans-serif">&copy; 
            2EditRegion8002 The Company, Inc. All
rights reserved. <u>Terms of Use and Disclaimer</u>
</font></td>
        </tr>
    </table></td>
  </tr>
</table>
<br>
</body>
</html>
<?php
$rsStates->Close();
?>
------------------------------------------------------

--- Victor Pendleton <VPendleton@stripped> wrote:

> What is the application you are using to insert and
> retrieve the blob data?
> Is the data actually being inserted? 
> 
> -----Original Message-----
> From: Stuart Felenstein
> To: mysql@stripped
> Sent: 8/18/04 2:49 PM
> Subject: Strange Text Field
> 
> Hoping I can figure this out.  Using MySQl
> 4.0.20-Standard. 
> 
> I have a table (tried this both myISAM and Innodb)
> with 12 fields, 3 are ints, 7 are varchars and 1 is
> set to text.  
> Form is using a textarea for input into the text
> field.  Basically a copy and paste of rich text. 
> (I'm
> not concerned with formatting right now)
> 
> Anyway it won't take and returns a vague SQL syntax
> error. If I try to input it directly into the
> database
> I get an error about the grid being 12 columns and
> the
> clipboard being 1 column.  Yet I had all the other
> fields filled in.  And all but the ID is set to
> allow
> nulls.
> 
>  Frustrated to figure out why this is occuring I
> created a table with 2 fields, one for the recordID,
> the other for the text dump.  Works like a charm.
> 
> So has anyone seen this before ?  It seems odd ,
> I've
> searched the manual and bug base and came up with
> nothing. 
> 
> Thank you ,
> Stuart
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:
>
http://lists.mysql.com/mysql?unsub=1
> 
> -- 
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:   
>
http://lists.mysql.com/mysql?unsub=1
> 
> 
Thread
Strange Text FieldStuart Felenstein18 Aug
  • Re: Strange Text FieldRhino18 Aug
    • Re: Strange Text FieldStuart Felenstein18 Aug
    • Re: Strange Text FieldStuart Felenstein18 Aug
RE: Strange Text FieldVictor Pendleton18 Aug
  • RE: Strange Text FieldStuart Felenstein18 Aug
  • RE: Strange Text FieldStuart Felenstein18 Aug
    • Re: Strange Text FieldDan Nelson18 Aug
      • Re: Strange Text FieldStuart Felenstein18 Aug
    • RE: Strange Text Field(Terry Riley)19 Aug
RE: Strange Text FieldVictor Pendleton18 Aug
  • RE: Strange Text FieldStuart Felenstein18 Aug