Accessing part of database table ( predefined SELECT)

Accessing part of database table ( predefined SELECT)

vinod_ccvvinod_ccv Posts: 75Questions: 0Answers: 0
edited September 2012 in Editor
Hi,
I am looking for an ajax call (pushing additional data or connecting href like myteam. php? user=id)so that i can transfer some predefined parameters for 'WHERE' 'key'='value' condition. This is to restrict the access for database table in use depends on user authority.
So the server call will fetching/editing only the selected part for each user. I am NOT looking for server side processing for the same.
[quote]Looking for any modification in php/javascript files that can do an additional " $VALUE AND" for $select string for all queries [/quote] . Suggestion invited please.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Is it static for the page? If so, just add it as a GET parameter to the 'ajax' URL that you give Editor. If its not static (i.e. it might change while the user is on the page) then you would most likely need to use something like the onPreSubmit event to attach extra information to the data object: http://editor.datatables.net/options/#onPreSubmit

    Allan
  • vinod_ccvvinod_ccv Posts: 75Questions: 0Answers: 0
    edited September 2012
    Hi Allen,
    Thank you for the quick reply. But still i could not find out how to implement it.
    1) If static page:
    Suppose my Ajax URL is[quote] browsers.php? 'RenderingEngine'='Gecko' [/quote] ( as seen in editor examples).
    I want my server should fetch only those rows where engine=='Gecko' from data base(MySQL).
    What is modification i am supposed to do in browsers.php file.

    2) onPreSubmit:
    [code]
    editor = new $.fn.dataTable.Editor( {
    "ajaxUrl": "'php/browsers.php'",
    "events": {
    " onPreSubmit": function (data) {
    /// How to pass strings 'engine' and 'Gecko' so that, it should be recognized by the server and only those rows which satisfy the condition WHERE 'engine'='Gecko' to be fetched ////
    }
    . .........................
    }
    [/code]
    @Allen Please Help.
    Regards
    Vinod
This discussion has been closed.