SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jun 2006
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Ajax and array in PHP

    Hi,

    I'm just started with AJAX and I've got an question...

    So I would like to make very simle AJAX photo gallery. The informations about the fotos are stored in MySQL db like: id, image_src, width, height, description.


    I'm sending the id of photo from JavaScript to php function, which connecting to database and return the result. My problem is that php script returning an array variable and I'vo no idea how to get to indexes of this array in php... Probably I can serialize the array with some selectors and than in JS split the result but it seems very strange for me...
    Sorry for my english, but I hope you understand what I mean.

    PS I dont use any classes like AdvancedAjax or Sajax etc.

    Thanks for suggestions or links.

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,510
    Mentioned
    163 Post(s)
    Tagged
    4 Thread(s)
    No, I'm not sure what you mean.
    Do you have a problem with PHP? Or do you have a problem with the result the PHP script sends back, and you don't know how to deal with it in JS?

  3. #3
    SitePoint Member
    Join Date
    Jun 2006
    Posts
    22
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re:

    Hi,
    exactly! I've got the problem with the result of PHP script when the rusult is an array. I don't know how to get each part's(inexes) of the array of php result in JS.
    Thanks!

  4. #4
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Probably I can serialize the array with some selectors and than in JS split the result
    Do that


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
  •