记录从网页插入sql表中的记录 [英] record inserting in sql table from web page
问题描述
大家好,
请帮助,我的问题是,
当我从正确插入的网页数据中将新记录插入到sql表中时,但是当我检查相关的sql表行中是否插入了正确的数据时.但是行的顺序是错误的.例如..
我在sql表中插入了一些记录,如下所示:
ID名称
1 dinesh
2 rakesh
3 rajesh
假设我要再插入一条记录,那么它将显示如下:
1 dinesh
2 rakesh
4穆克什
3 rajesh
ID是表中的主键,然后显示为什么.
在Adavance中表示感谢.......
hi all,
Please help, my problem is,
when i am inserting new record into a sql table from my web page data inserted properly but when i check my related sql table row is inserted with proper data. but sequence of row is wrong. for example..
i am inserted some records in my sql table like as follows:
ID Name
1 dinesh
2 rakesh
3 rajesh
suppose i am inserting one more record then it will show like as below:
1 dinesh
2 rakesh
4 mukesh
3 rajesh
ID is primary key in table then why it show like.
Thanks in Adavance.......
推荐答案
从表中检索数据时,请确保在查询/视图中添加了Order By子句!例如
When you retrieve the data from the table, make sure that you added an Order By clause in your query/view! E.g.
SELECT *
FROM MYTABLE
ORDER BY ID ASC
检查如何定义架构...
check how you have defined the schema...
使用ORDER BY子句
例如;
use ORDER BY clause
example;
SELECT supplier_city
FROM suppliers
WHERE supplier_name = 'IBM'
ORDER BY supplier_city;
这篇关于记录从网页插入sql表中的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!