Editor Manuel İnsert command

Editor Manuel İnsert command

omurltsomurlts Posts: 35Questions: 6Answers: 0

do I use the datatables in database class manually

insert 
update 
delete
select 
row count 

how use this ?

how to get the error codes ?

Answers

  • colincolin Posts: 15,118Questions: 1Answers: 2,583

    Hi @omurlts ,

    I don't understand your question, sorry. Please could you give more detail,

    Cheers,

    Colin

  • omurltsomurlts Posts: 35Questions: 6Answers: 0

    $insert = $db->insert());
    this working but
    update delete not working ?

    any example have manuel insert, delete , update

  • colincolin Posts: 15,118Questions: 1Answers: 2,583

    We're happy to take a look, but please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • allanallan Posts: 61,452Questions: 1Answers: 10,055 Site admin

    If you don't want to use the Editor PHP (or .NET or NodeJS) class, then I'd suggest probably just not attempting to modify it here. It was designed to work with a DataTable insert, not from a separate form.

    If you do want to use the database class that Editor comes with, the API reference for it is here.

    Allan

  • omurltsomurlts Posts: 35Questions: 6Answers: 0

    just needed 1 example
    it should not be so difficult
    keep in mind that there is little English among your customers

    good days

  • allanallan Posts: 61,452Questions: 1Answers: 10,055 Site admin

    If you want to use the Editor Database class then an insert would look like:

    $db->insert( 'myTable', [
      "column1" => "value1",
      "column2" => "value2",
      ...
    ] );
    

    Where of course columnX is the column name and valueX is the value to write to that column - normally that would come from $_POST.

    Allan

  • omurltsomurlts Posts: 35Questions: 6Answers: 0

    insert working but delete or update not working

    $db->update( 'table', [
      "column1" => "value1",
      "column2" => "value2",
    
    ] , ['id','5']); 
    

    this correct usage ?

  • omurltsomurlts Posts: 35Questions: 6Answers: 0
    edited January 2019

    i solved problem

    example

    $db->insert( 'myTable', ["column1" => "value1","column2" => "value2"] );
    $db->update( 'myTable', ["column1" => "value1","column2" => "value2"],['column' => 'value'] );
    $db->delete( 'myTable', ['column' => 'value'] );
    
This discussion has been closed.