SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru afridy's Avatar
    Join Date
    Mar 2007
    Posts
    966
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Passing parameters via AJAX

    Hello,

    we have a position name in database like 'Technician, Instrument & Electronics'
    Now

    PHP Code:
    $query_sal="SELECT * FROM salary_scale WHERE position='$position_name'";
    print 
    $query_sal 
    out put

    SELECT * FROM salary_scale WHERE position='technician, instrument '
    why it is not processing the &

  2. #2
    SitePoint Guru afridy's Avatar
    Join Date
    Mar 2007
    Posts
    966
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by afridy View Post
    Hello,

    we have a position name in database like 'Technician, Instrument & Electronics'
    Now

    PHP Code:
    $query_sal="SELECT * FROM salary_scale WHERE position='$position_name'";
    print 
    $query_sal 
    out put



    why it is not processing the &
    i am sorry, this is an ajax problem.
    i found the problem now. actually the variable $position_name holds only the 'technician, instrument' part which was returned by an ajward post before the query.

    This code in ajax file did the fix

    Code:
        params = params + "&position=" + encodeURIComponent(position);


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •