Forums

Deleting Record in a Table

Grizzled 05 Feb, 2012
Hi There,

I want to delete a record in the database Table for my form.

But I am getting an error.

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 1 SQL=DELETE FROM jos_chronoforms_orchardsgardenapplication13 WHERE cf_id IN ()

The website is using mysql 5.0.51a

How do I resolve this?

Thanks, Chuck
GreyHead 05 Feb, 2012
Hi Chuck,

The list of 'cf_id's to delete is empty WHERE cf_id IN ()

Bob
Grizzled 06 Feb, 2012
When I initially created the table, I turned off the cf_id.

So I guess I should leave that on. What exactly does that do?

And how do I delete the records?

I guess I could just export the records to csv and then recreate table?

Thanks again, Chuck
GreyHead 06 Feb, 2012
Hi Chuck,

The cf_id column is the primary key for the table - the one that is used to uniquely identify the records. You should only turn it off if you have an alternative key set; to work with the Joomla! database code the primary key should be a autoincremented integer columns (which cf_id is).

If you know your way roudn PHPMyAdmin you can add the column to the existing table and re-index it.

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