如何在数据库中已存在的图像之前插入图像 [英] How to insert image before already existing image in database

查看:82
本文介绍了如何在数据库中已存在的图像之前插入图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好编码器我只是想知道这是否可以在数据库中的任何其他图像之前将图像插入数据库。



假设我有文件加载器上传图像和下拉列表以显示这些图像的优先级。

现在我的数据库中有10个图像,我绑定,优先级与下拉列表。现在当我上传新图像时,我可以看到图像的优先级到下拉列表中。现在那个部分已经完成了



现在我想要的是当我上传新图像并从下拉列表中选择优先级之前图像存储在数据库之前的优先级数据库中的图像。

示例:

i选择文件加载按钮上传文件并从下拉列表中选择优先级编号5。

现在图像将以优先级5存储,而优先级为5的图像现在具有优先级编号6,依此类推..



我怎么能这样做

提前谢谢

Hi coder i just want to know is this possible to insert an image into database before any other image in the database.

Suppose i have file-up loader to upload image and a drop-down list to show priority of those images.
now i have 10 images in my database and i bind, priority with the drop-down list. Now When i upload new image i can see priority of images into drop-down list. Now that part is been done

Now what i want is when i upload new image and select priority from the drop-down list that image store in the database before the priority of the image in the database.
example:
i select file-up loader button to upload file and select priority number 5 from the drop-down list.
now that image will store at priority number 5 and image which is at priority number 5 now have priority number 6 and so on..

How can i do that
Thanks in advance

推荐答案

否。



数据库做除非您在SELECT语句中使用ORDER BY子句显式指定项目,否则不必以任何特定顺序返回项目。如果你没有添加ORDER BY子句,那么记录将以当时对数据库引擎方便的顺序返回通常,这是它在数据库存储中遇到它们的顺序。文件,它往往按照它们插入数据库的顺序 - 但它不一定是。删除记录将留下它可以填写的空白,或者它可以完全重新排序记录,它会压缩提供后备存储的文件。



如果你想要一个特定的订单,那么你必须在表中有一个列,允许你在表上使用ORDER BY子句。
No.

Databases do not have to return items in any particular order unless you explicitly specify it in the SELECT statement with an ORDER BY clause. If you do not add an ORDER BY clause, then records will be returned in whatever order is convenient to the database engine at that moment. Normally, this is the order in which it encounters them in the database store file, which tends to be in the order they were inserted to the database - but it doesn't have to be. Deleting records will leave "gaps" which it can fill if it wants to, or it may reorder records completely hwne it compacts the file(s) providing the backing stores.

If you want a specific order, then you have to have a column in the table that allows you to use an ORDER BY clause on the table.


这篇关于如何在数据库中已存在的图像之前插入图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆