Unknown column in SQL

misku 20 Nov, 2008
Hello,
I'm using ChronoConnectivity v1.2 and Joomla 1.5.7.
While trying to edit some records at backend everything is ok. Unfortunately when I'm trying to add a new record an error occur:
Table pmdg_trenerzy::store failed - Unknown column 'ordering' in 'field list' SQL=INSERT INTO `pmdg_trenerzy` ( `id_trener`,`imie`,`nazwisko`,`ordering` ) VALUES ( '0','aaa','aaa','' )


The error doesn't depend on the table. It seems that ChronoC tries to insert an additional field to my table. This field is called 'ordering'. I really don't know where does it come form. My record edit template is shown below:
<?php
$editor    =& JFactory::getEditor();
?>

<table>
  <tr>
    <td>Imię:</td>
    <td><input type="text" name="imie" id="imie" size="100" value=""></td>
  </tr>
  <tr>
    <td>Nazwisko:</td>
    <td><input type="text" name="nazwisko" size="100" value=""></td>
  </tr>
</table>
<input type="hidden" name="id_trener" value="">


If anyone can tell me where can I find the part that insert fields into database in the source code, I can search for it and try to change it on my own. Thank You for this great component!
Max_admin 20 Nov, 2008
Hi misku,

did you add the ordering field to the ordering text box at the admin config tab of the connection ? if not then this may be a bug, try to find this code in admin.chronoconnectivity.php:
if(!$post[$primary]){
		$row->ordering = $row->getNextOrder();	
	}


comment this code and see if it helps ?

Let me know!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
misku 20 Nov, 2008
Hi Max,
I didn't add the ordering field to the ordering text box. It turns out we've found a bug 😀 Commenting these lines helped and now everything works great.
Thank You for Your help. If I run against any problems, I certainly will let You know. I'm pleased to use such helpful module for free.

Best regards,
misku
(Poland)
Max_admin 20 Nov, 2008
Hi misku,

ok, we found the bug, commenting is not the best solution, lets do this now and tell me teh effect, replace the 3 lines with this:


if(trim( $paramsvalues->orderingname)){
if(!$post[$primary]){
      $row->ordering = $row->getNextOrder();   
   }

}


let me know how this works!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
misku 21 Nov, 2008
It should work as it tests if the argument is empty and it was in my example. And... yes it works🙂
You could tell me to add just an IF condition😉
Thank You very much.
Max_admin 21 Nov, 2008
Thanks for reporting back!🙂
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
kavaXtreme 24 Nov, 2008
Had the same issue, and that worked for me as well.
gporterfield 10 Dec, 2008

Hi misku,

ok, we found the bug, commenting is not the best solution, lets do this now and tell me teh effect, replace the 3 lines with this:


if(trim( $paramsvalues->orderingname)){
if(!$post[$primary]){
      $row->ordering = $row->getNextOrder();   
   }

}


let me know how this works!

Regards
Max



Max:

I think the same change is needed in chronoconnectivity.php. I ran into this same error tonight with my "almost ready for live site" front end. Applying the change in chronoconnectivity.php fixed the problem.

George
Max_admin 10 Dec, 2008
Thanks George, fixed this too!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.