Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8251623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T00:17:52+00:00 2026-06-08T00:17:52+00:00

I had a task to slide images from a mysql database using jquery slide

  • 0

I had a task to slide images from a mysql database using jquery slide and not the animation scripts. The slide is supposed to show at least the most recent ten images that was uploaded. With that I first of all wrote a random query

mysql_query("select * from tblname order by rand() limit 1);

But as expected, it picks the images at random irrespective of when it was posted and of course it wasn’t the most recent ten. After some thought I now had to first run a query to get the most recent ten

mysql_query("select * from tblname order by ID limit 10);
while($row=mysql_fetch_array($sql){
    $slideid=$slideid.",".$row['recordid'];
}

this of course results to a variable of this order

$var="23,22,24,34,27,78,56,87,98,55";

I tried handling it like an array but it wasn’t giving any positive result, hence I had an issue of how to pick this numbers and use it for the slide

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T00:17:54+00:00Added an answer on June 8, 2026 at 12:17 am

    Based on your comments I will offer my 2p into the mix

    this is what I did $slideid=”23,22,24,34,27,78,56,87,98,55″; $arr =
    explode(‘,’,$slideid); foreach ($arr as $val) { //lets get the
    variables from the form post $rs = mysql_query(“SELECT * FROM tblname
    WHERE id=’$val'”) or die(mysql_error());
    while($row=mysql_fetch_array($rs)){ echo “<img src=’image/$image’>”; }
    } the images are displayed one by one using jquery slide

    Now I think we are wasting time dealing with exploding this variable because mysql has the nifty IN() function (possibly in other db’s I don’t know)

    $slideid = "23,22,24,34,27,78,56,87,98,55";
    $rs = mysql_query("SELECT * FROM tblname WHERE id IN({$slideid})") or die(mysql_error());
    while ($row = mysql_fetch_assoc($rs))
    {
        echo "<img src='image/{$row['image']}' />";
    }
    

    I hope this helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am not too versed in C++, but I had the task of designing
[CrossPost From MSDN] I had a task that, I need to send a generic
I had given the task on Character Based Reporting.. I am using BIRT along
I had a task to write simple game simulating two players picking up 1-3
I had a task to write simple game simulating two players picking up 1-3
I recently had the task of adding a barcode onto a SSRS report without
I have had no luck with this task so far so grateful for any
Had to download Command Line Tools from Apple to get make to work, but
Had received a module from CCAVENUE and it was working fine with Magento 1.6.2...
I am using the reportviewer control from VS 2010 to create client side reports

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.