Jump to content

Get sql specific collum and row


rubyarat2010

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.