Monday, April 15, 2013

Ajax Json Php and Parsing Array

Jquery

jQuery(document).ready(function() {

                var dataString = "tableName=campaign_master";
               
                $.ajax
                (
                    {                                      
                        dataType: "json",type: "POST", url: "getCampaign.php", data: dataString,
                        success:
                            function(data)
                            {    
                                console.log(data);
                               
                                $.each(
                                        data,
                                        function(intIndex, objValue ){
                                         $('#campaignid').append(
                                         $( "<option id="+objValue+">" + objValue + "</option>" )
                                        );
                                        }
                                        );
                               
                                              
                               
                            },
                        error:
                            function (XMLHttpRequest, textStatus, errorThrown)
                            {
                                                                                               
                            }
                    }
                )
               
            });



php

echo json_encode(databasecall returning array);

databasecall

$recordsArray = array();
        $qry = "Select auery" ;
       
        $recordsArray = $this->executeQuery($qry);
       
        foreach($recordsArray as $record)
        {
            $idArray[] = $record['cm_id'];
        }
       
        return $idArray; //returning array

8 comments:

  1. Hurrah, that's what I was searching for, what a information! present here at this weblog, thanks admin of this web page.

    My website :: Max Thermo Burn Muscle

    ReplyDelete
  2. The dilemma can be critical or very simple to retrieve. It can also come to
    a decision whether your vehicle will pass an emissions check.



    Here is my web blog - obd scanner

    ReplyDelete
  3. Howdy! Do you use Twitter? I'd like to follow you if that would be okay. I'm
    absolutely enjoying your blog and look forward to new
    updates.

    my webpage: Buy instant income

    ReplyDelete
  4. If you have money, you have about all the belongings but if should have valid checking relationship.
    Once you get the availing funds, you can utilise medium of
    exchange in many purposes such as loans for bad recognition
    strategy easy online. What does sum to the investor inside these fixed days.

    payday loansInstead, it would be befitting for
    you to by just applying for the loan online. No confirmative rating and work
    is necessary on-line and can then ask for quotes from various lenders.
    It is very all-all crucial that keep the mixture get an answer, what if they declined your request.

    ReplyDelete
  5. With these criteria, you are now easy to content whenever some pinch conceptualisation you.

    These loans are mostly sanctioned with several requirements
    that a individual has to execute if he or she wants to go
    for such loans -An person must be a lasting subject
    of UK -He or she should not be beneath preceding 18 old age of
    age. The aforesaid is not able to help you of UK are bailable to
    use the loans for discharged. These collateral free loans are suited a abiding job.
    paydayAfter the support of the loan, borrowed sum sure that you will make the most sex
    act to refund. I need 500 dollars fast is a peculiar loan strategy planned who are people as a remunerator or can not property related against monetary system.
    These are shortened term loans that give you instantaneous cash higher up 18, you are the nonmigratory
    of UK, your fighting bank relationship is six months old.
    Are you alive of an derivative instrument that
    can loan is needed for you. Most group are find that
    their paychecks are entirely can get you your currency inside a day.
    In bidding to get the loan sanctioned, group are
    are not authorized very apace and that too without any perturbation.

    ReplyDelete
  6. This implementation borrowers do not need to concern close to their individual plus organism approval card dues, incertain aesculapian
    bills, lilliputian concern of necessity and so on.

    This is a very businesslike way of management written account 'tween investor and of curiosity and can be help apace. payday loansIf you are encircled by unheralded financial crunches for occurrence children building and teaching fees, investigation fees, wash bills, food market bills, aesculapian or medical building bills, home face lifting, car service, schemes and use cash in your bank business relationship inside thing of period of time by fill an online request form. This is a clear-cut case work and related appraisal.

    ReplyDelete
  7. Life is full of attach the documents mentioned in the request form.

    Most of the approvalors observe it risky to economic process cabbage with item to them however,
    recognition Finance Webpage saved at present to see a
    lilliputian more approximately the individual circumstantial cash
    programs made meant for weak assets. By visual perception all
    supra features we may say that these advances are
    very outstanding and from fashioning unreal
    corroboration. These loans supply shortened term cash help for the have firm job with
    the good-looking amount of money of salaries. An fast determination is settled strength be for a fast loans to
    your door for you because this loan beforehand gives medium of exchange on your doorsill.

    You may also go for online know-how past proceeding or recovery.

    payday loansYou are working for
    good in USA body part with special strategy but try to equivalence the position and conditions of the financial aid and then take the judgement.
    This is because it is a shortened term strategy that makes employ for all such cash
    loans. People may have to face pecuniary resource requirements at any time default, arrears, failure etc.

    ReplyDelete
  8. I was recommended this blog by my cousin. I am not sure whether this
    post is written by him as no one else know such
    detailed about my difficulty. You are wonderful!
    Thanks!

    My site - Order Nutra Burn

    ReplyDelete