Jump to content

Recommended Posts

You could also run a regular select query, with order by id desc and limit 5, dump the results in an array in php, and just take the end element of the array, or assign the value of array_pop to another variable. I don't know for certain which way is more efficient, but I suspect the SQL-only way would be.

What I mean is, are there 6 different links stored in each `imagelink` field? In other words, does the record look like this:

 

--------------------------------------------------------------------------------------

|    id    |                          imagelink                                      |

--------------------------------------------------------------------------------------

|  56    |        link1, link2, link3, link4, link5, link6                        |

--------------------------------------------------------------------------------------

Everything you said indicated you wanted to retrieve one record. Now you say that was just an example and you really wanted to do was retrieve 6 records? How about you specify exactly what you want to do, provide a sample of the actual data, the structure of the table, and the results you hope to get from the data. Examples don't work so well with writing code, because code does exactly what it is written to do.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.