Forums

Table not found.. but it exists!

jewelz87 21 Oct, 2009
I am using chronoforms to make a simple form to add and remove credits from a user, so i have a table jos_credits where the form, after submission, should go and increase the value where the user id is equal to actual user's id. The problem is when i open
$row =& JTable::getInstance("jos_credit", "Table");
chronoforms gives me error "Table jos_credit not supported. File not found.". , even if the table exists. I write that code in the "Form HTML" section. What's wrong?
GreyHead 21 Oct, 2009
Hi jewelz87,

I guess because Joomla can't find the matching table file?? Have you created one?

And why put it in the Form HTML if you want to go the update after submission?

Just add the query code to one of the OnSubmit boxes.

Bob
jewelz87 22 Oct, 2009
right, that's the code i use to display the current credits a user has before recharging, so i use it on the form itself, and yes the table exists: if i associate the table to chronoforms it works, but i don't really want chronoforms to store all the fields the user entries, but just to sum the credit the user enters to the table, so i think i can use a trigger but it would be better for me not to use that and doing that just all in the application. I wonder if that's possible with chronoforms. Thank you for the support.
GreyHead 22 Oct, 2009
Hi jewelz87,

I asked if the table 'file' exists, to use JTable there needs to be a php file that describes the file. Actually you need t load a table class, ChronoForms does this on the fly from the database but including a file is the more usual way.

If you make a DB Connection between your form and an exisiting table ChronoForms will update the table -- if the Primary Key is included in the form data and the value matches an existing primary key value; if the value does not match then it will create a new record.

Yes it is possible with ChronoForms. Either use the DB Connection or add a MySQL query to one of the the OnSubmit boxes.

Bob
jewelz87 23 Oct, 2009
Thank you very much, i did it! I didn't know how to use the JTable and now i know.. it's quite an ORM but very strange, and quite unuseful 🙄 . But now it works, so thank you very much for the support and for the profuct: it's great, even I think you can improve html-generation that often fails in my case, and customization of the validation that it's not very well done for my sake. Thank you very much!
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger