Is there an easy way to update data to a DB table?
If you had a simple table, say:
And you wanted to update a record, you would prepare the data to update in the following array:
Next, you would define what record you plan to update. You do this by building a search array.
Then to update the database:
'my_faq' => " faq_id I4 AUTO PRIMARY, question C(255) NOTNULL, answer C(255) NOTNULL, ",
And you wanted to update a record, you would prepare the data to update in the following array:
$my_data = array( 'question' => "What is this project again?", 'answer' => "Its the Bitweaver CMS and Application Framework!", );
Next, you would define what record you plan to update. You do this by building a search array.
$my_id = array ( "name" => "faq_id", "value" => 5, );
Then to update the database:
$gBitDb->associateUpdate( 'my_faq', $my_data, $my_id );
Comments