UPDATE record Form

disass27

New Member
Hi,
I would like to know how can to create a form for to UPDATE records already in the db (and where insert the SQL Code provided: SELECT * FROM `table` WHERE id = $ id_ricevuto)?

Thank you
 
You're not very specific. If you want to add records in a DB table using a form and also display this table or the records to users, you may create a new fabrik table and use the 'link to table' option under the 'Data' tab. That way your form will also be created with all the fields from your DB table.
If you only need a form to record in the DB, you can create a form and all the needed elements and use a Form submission plugin> Run PHP to record in the DB table.
 
Thanks primarily to the availability ', I try to explain better.

I would like to make with Fabrik a form that updates a particular record in my table. The record to be updated is variable and is determined to value passed in the query-string.

Example:

<?php

//ID RECORD TO UPDATE
$id_ricevuto = $_GET["id_selezionato"];

$result = mysql_query("UPDATE my_table SET NickName='$NickName' WHERE id='$id_ricevuto'");

?>

Can I make the form with Fabrik in automatically?

Thanks
 
Resolved

I understand the solution, is extremely simple (I lost a lot of time trying to change it from code).

peamak thanks for the great help :)
 
If your 'id' field is the primary key for the table, you can load a specific form view by just specifying the rowid on the query string ...

index.php?option=com_fabrik&view=form&fabrik=X&rowid=Y

.... obvious set X to your form's numeric ID, and Y to whatever 'id' you want to load.

If the 'id' is NOT the PK on the table, you'll have to do:

index.php?option=com_fabrik&view=form&fabrik=X&rowid=Y&usekey=element_name

... where element_name is the element name of the id you want to key on.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top