can't create table with all fields

mja1356 15 Apr, 2009
Hi
I created a form in old version of CF and it works ok but becouse i need server validation upgrade my CF to latest version.
now when i want to create table it doesn't recognize 8 fields of my form.whereas
I had no problem in old version.
thoi trang cong so, vay lien cong so, do noi y, quan ao nam, bo do nu, do lot nam, do dung cho me, may hut sua cao cap, thoi trang be gai cao cap, ban buon quan ao, do lot[/url]
this is my form code:

<?php
?>
<body onLoad="return DoAllThese(this.form)">
<style>


#label_win,#label_lost,#loss,#game,#tip,#line,#odd {
background-color:#f8f8f8;
text-align:center;
border:0;
padding:0;
}
#win {
text-align:center;
}
.sub{
background-color: #999999;
border:0;
}
#slip{
background-color: #0C0C0C;
color:#FFFFFF;
}
#tb {
border-left: thin;
border-right:thin;
border-left-color:#000000;
border-right-color:#000000;
}
#game {
border-bottom:1px;
border-bottom-color:#000033;
margin-bottom:4px;
}
#loss,#win {
direction:ltr;
}
</style>
<?php
//connet to MySQL server
$db = mysql_connect("localhost", "test1", "123456");
mysql_select_db('test');
$dt=date('Y-m-d',time()-0.23*3600);
$cf=$_GET['cf_id'];
$gid=$_GET['g_id'];
$fid=$_GET['f_id'];
$user =& JFactory::getUser();
$userId = $user->get( 'id' );

$query = "select * from jos_chronoforms_parsibet where cf_id='$cf' order by Time_Hour, Time_Minute asc";
$cr="select * from jos_comprofiler where user_id='$userId'";

$resul = mysql_query($cr);
$raw = mysql_fetch_row($resul);

$result = mysql_query($query);
$row = mysql_fetch_row($result);

echo "<input type='hidden' name='ccredit' value='$raw[22]' id='ccredit' />";
echo "<input type='hidden' name='cfid' value='$row[0]'/>";
$a=(time()%100000);
echo "<input type='hidden' name='betcode' value='$userId$a'/>";
echo "<input type='hidden' name='userid' value='$userId'/>";
define("A","A");
   define("B","B");


  ?>
  <table align="right"  dir="rtl" id="tb">
  <tr>
  
    <td colspan="2" align="right" id="slip"> سربرگ شرط</td>
  

 </tr>
  <?php
  echo "<tr>";
  
  
  echo "<td colspan='2' align='right'><input type='text' value='$row[6]    $row[8]' name='game' id='game' readonly></td>";
   echo "</tr>";
  

  echo "<tr>";
  if ($gid==1)
   echo "<td width='60'><input type='text' value='بازي کامل' name='tip' id='tip' readonly size='7'></td>";//kind of bet
	elseif ($gid==2)
	echo "<td><input type='text' value='نيمه اول' name='tip' id='tip' readonly size='7'></td>";
	else
	echo "<td><input type='text' value='Over/Under' name='tip' id='tip' readonly' size='7'></td>";
    
	echo "<td>";
   echo "<table dir='rtl'>";
  echo "<tr>";
switch ($gid)
{
case '1' :
{
if ($fid==1 and $row[28]==A)
echo "<td dir='ltr' id='line_td'><input type='text' value='$row[27]' name='line' id='line' readonly size='3'></td>";
elseif ($fid==1 and $row[28]==B)
{
$x1=$row[27]*(-1);
echo "<td dir='ltr'><input type='text' value='$x1' name='line' id='line' readonly size='3'></td>";
}
elseif ($fid==2 and $row[28]==A)
{
$x1=$row[27]*(-1);
echo "<td dir='ltr'><input type='text' value='$x1' name='line' id='line' readonly size='3'></td>";
}
else
echo "<td dir='ltr'><input type='text' value='$row[27]' name='line' id='line' readonly size='3'></td>";
}
break;

case '2' :
{
if ($fid==1 and $row[30]==A)
echo "<td dir='ltr'><input type='text' value='$row[29]' name='line' id='line' readonly size='3'></td>";
elseif ($fid==1 and $row[30]==B)
{
$x1=$row[29]*(-1);
echo "<td dir='ltr'><input type='text' value='$x1' name='line' id='line' readonly size='3'></td>";
}
elseif ($fid==2 and $row[30]==A)
{
$x1=$row[29]*(-1);
echo "<td dir='ltr'><input type='text' value='$x1' name='line' id='line' readonly size='3'></td>";
}
else
echo "<td dir='ltr'><input type='text' value='$row[29]' name='line' id='line' readonly size='3'></td>";
}
break;

case '3' :
{
if ($fid==1)
echo "<td><input type='text' value='O $row[17]' name='line' id='line' readonly size='3'></td>";
else
echo "<td><input type='text' value='U $row[17]' name='line' id='line' readonly size='3'></td>";
}
break;
}


switch ($gid)
{
case '1' :
{
if ($fid==1)
echo "<td dir='ltr'><input type='text' value='$row[9]' name='odd' id='odd' readonly size='2'></td>";
else
echo "<td dir='ltr'><input type='text' value='$row[10]' name='odd' id='odd' readonly size='2'></td>";
}
break;

case '2' :
{
if ($fid==1)
echo "<td dir='ltr'><input type='text' value='$row[13]' name='odd' id='odd' readonly size='2'></td>";
else
echo "<td dir='ltr'><input type='text' value='$row[14]' name='odd' id='odd' readonly size='2'></td>";
}
break;

case '3' :
{
if ($fid==1)
echo "<td dir='ltr'><input type='text' value='$row[18]' name='odd' id='odd' readonly size='2'></td>";
else
echo "<td dir='ltr'><input type='text' value='$row[19]' name='odd' id='odd' readonly size='2'></td>";

}
break;
}

echo "</tr>";
echo "</table>";
echo "</td>";
echo "</tr>";

echo "<tr>";
echo "<td align='center'><input type='text' id='label_win' name='label_win'  readonly='readonly' size='5'></td>";
echo "<td align='center'><input type='text' id='label_lost' name= 'label_lost' readonly='readonly' size='5'></td>";
echo "</tr>";
echo "<tr>";

echo "<td><label></label><input type='text'  name='win' id='win' onKeyUp=\"return change(this.form)\" size='8'></td>";


echo "<td><input type='text'  name='loss' id='loss' readonly size='8'></td>";


if ($fid==1)
echo "<td><input type='hidden' id='HG' name='HG' value='1'></td>";
else
echo "<td><input type='hidden' id='HG' name='HG' value='2'></td>";
$bb=$row[26];
if ($bb==1)
echo "<input type='hidden' name='branch' value='فوتبال'/>";
elseif ($bb==2)
echo "<input type='hidden' name='branch' value='بسکتبال'/>";
elseif ($bb==3)
echo "<input type='hidden' name='branch' value='هندبال'/>";
elseif ($bb==4)
echo "<input type='hidden' name='branch' value='تنيس'/>";
else
echo "<input type='hidden' name='branch' value='فوتسال'/>";


echo "<input type='hidden' name='cat' value='$row[25]'/>";
echo "<input type='hidden' name='host' value='$row[6]'/>";
echo "<input type='hidden' name='guest' value='$row[8]'/>";
echo "<input type='hidden' name='ftga' value='$row[11]'/>";
echo "<input type='hidden' name='ftgb' value='$row[12]'/>";
echo "<input type='hidden' name='htga' value='$row[15]'/>";
echo "<input type='hidden' name='htgb' value='$row[16]'/>";
echo "<td><input type='hidden' id='stats' name='stats'></td>";
echo "<td><input type='hidden' id='status' name='status'></td>";
echo "<td><input type='hidden' id='ex1' name='ex1'></td>";
echo "<td><input type='hidden' id='ex2' name='ex2'></td>";
echo "</tr>";
?>
	
<tr class='sub'><td>	
  <input type="submit" value="ارسال" name="B1" id="sub" class="sub"  onclick="return validate(this.form)" size="8"></td>
  

  <td><input type="reset" value="انصراف" name="B2" size='20' class="sub" onclick="window.close()"></td>
  
    </tr>
	
	
</table>
</body>
GreyHead 15 Apr, 2009
Hi mja1356,

The code isn't easy to read but it looks as though all the names are defined OK. Which fields aren't being created?

The answer probably is to use the 'Add Field' button at the bottom of the create table form to add the missing fields by hand.

Bob
mja1356 15 Apr, 2009
Hi
these fields(game,tip,line,odd,label_win,win,B1,B2) don't show in create table page.
meanwhile add field button at the end of page doesn't work .
GreyHead 15 Apr, 2009
Hi mja1356,

I copied and pasted your code unchanged into a new form in CF RC4.11 and Joomla 1.5.10 and it works perfectly apart from the B1 & B2 fields. I suspect that the problem with those is that the Arabic value is before the name attribute and that if you make sure that the Name comes first they will be OK too.

Here's the create code from the table I made - you may need to change some of the field types for your needs.
DROP TABLE IF EXISTS `joomla15c`.`jos_chronoforms_test_form_11`;
CREATE TABLE  `joomla15c`.`jos_chronoforms_test_form_11` (
  `cf_id` int(11) NOT NULL AUTO_INCREMENT,
  `uid` varchar(255) NOT NULL,
  `recordtime` text NOT NULL,
  `ipaddress` text NOT NULL,
  `cf_user_id` text NOT NULL,
  `ccredit` varchar(255) NOT NULL,
  `cfid` varchar(255) NOT NULL,
  `betcode` varchar(255) NOT NULL,
  `userid` varchar(255) NOT NULL,
  `game` varchar(255) NOT NULL,
  `tip` varchar(255) NOT NULL,
  `line` varchar(255) NOT NULL,
  `odd` varchar(255) NOT NULL,
  `label_win` varchar(255) NOT NULL,
  `label_lost` varchar(255) NOT NULL,
  `win` varchar(255) NOT NULL,
  `loss` varchar(255) NOT NULL,
  `HG` varchar(255) NOT NULL,
  `branch` varchar(255) NOT NULL,
  `cat` varchar(255) NOT NULL,
  `host` varchar(255) NOT NULL,
  `guest` varchar(255) NOT NULL,
  `ftga` varchar(255) NOT NULL,
  `ftgb` varchar(255) NOT NULL,
  `htga` varchar(255) NOT NULL,
  `htgb` varchar(255) NOT NULL,
  `stats` varchar(255) NOT NULL,
  `status` varchar(255) NOT NULL,
  `ex1` varchar(255) NOT NULL,
  `ex2` varchar(255) NOT NULL,
  `B1` varchar(255) NOT NULL,
  `B2` varchar(255) NOT NULL,
  PRIMARY KEY (`cf_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

Bob
This topic is locked and no more replies can be posted.