Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Display MySql data into jquery slider !

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #43878
    Raza
    Member

    I’ve been using an existing script to integrate with a jquery slider, I’ve tried lots of jquery sliders but Im always stuck at the same point & which is :

    that somehow I can’t tell the slider or script(which gets products from mysql) to continue displaying next products on the next slide.
    I’ve posted this issue on stackoverflow & other sites as well but useless.

    Now I want a suggestion or any easy way out of this issue. I just want to display 4 products at a time on one slide, then the next 4 products on the 2nd slide & so on…!

    these are the products I want to display using a jquery slider:
    http://www.tradeglobus.com
    (the products inside the “**Top Wholesale Suppliers**”)
    And if I increase the number of products from backend, it’ll display the slide numbers/bullets.
    its using jquery but its not animated.

    Please guys any help would be greatly appreciated, as Im so tired of working on same thing from about 2 weeks now :(

    Thanks in advance……!

    #130607
    CrocoDillon
    Participant

    How many products in total? If it’s not too much I’d just load them all into the slider, and use jQuery to show only 4 of them at a time.

    Else it gets more complicated, you’d need a php script that queries your database for 4 next (or previous) products and that script also needs to tell if there is a next (or previous) so you can show or hide those buttons. A query like tanners is possible if you know the SKUs (except it should be `where SKU in (12345, 54321, 23425, 14522)`), but if you don’t know the SKUs you can use `limit 4 offset ?` instead of `where`, where offset is a multiple of 4.

    Then you need to call that script using AJAX (I like jQuery’s `.post()` function, it’s easy), and display the results.

    #130618
    Raza
    Member

    what the hell ? I can’t submit code in my post :S
    its just keep executing it !

    well I was about to tell you that I have a PHP code which gets the products from MySQL into an existing slider, I tried to use it with many other jquery sliders, but its not displaying next 4 products on 2nd/3rd/4th slides, its just repeating the queries & displaying first 4 products on every slide.

    is there any way to show you this php code ?

    #130619
    CrocoDillon
    Participant
    #130620
    Raza
    Member

    Thanks Croco,

    here’s the php code at github:
    https://gist.github.com/anonymous/5309080

    check it & plz guide me how can I integrate this with any jquery slider.
    & this line controls the number of products to be displayed:

    $Query = clsMembers::getSupplierByLimit(16, 0);

    #130614
    Podders
    Participant

    Add a loop counter and use the magical Modulo function to display the results in blocks of four,

    http://php.net/manual/en/internals2.opcodes.mod.php

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘Other’ is closed to new topics and replies.