如何仅从数据库中检索最后插入的行 [英] How to retrive only the last inserted row from the database

查看:82
本文介绍了如何仅从数据库中检索最后插入的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。我试图从表单中获取输入,将其打印在一个页面上,表单上填写的信息必须以字母方式显示在页面上。但是现在发生了什么我做了但它显示了数据库中的所有内容,虽然我只想要显示最后一个条目。对于这封信。我的桌子上没有id所以不能使用last_insert_id()


任何我对我如何做到这一点的权利。谢谢提前

Hi all. I am trying to get the input from a form to print it out on a page where the information filled on a form must be on the page in a letter manner.But now what is happening I do that but it displays everything in the database , while I only want the last entry to be displayed.To the letter.I dont have id on my table so cant use last_insert_id()

Any I dea to how I do that .Thanks in advance

推荐答案

有100种方法可以做到这一点,但没有显示你的代码,它是没用的。所以显示你现在使用的代码。


Ronald:很酷:
There are a 100 ways to do this, but without a display of your code, it''s no use. So show the code you are using now.

Ronald :cool:



有100种方法,但没有显示您的代码,它是没用的。所以显示你现在使用的代码。


Ronald:很酷:
There are a 100 ways to do this, but without a display of your code, it''s no use. So show the code you are using now.

Ronald :cool:



这是我的代码..... ..它应该在这封信中出来,只有最后的信息需要填写。选择部分肯定是错的因为我从表中选择*不确定如何pu它.Thanx


< ;?

Here is my code....... It is supposed to come out in this letter and only the last entrys information needs to be filled in.The select part surely is wrong also coz I select * from the table not sure how to pu it .Thanx

<?


username =" root";
username="root";


这篇关于如何仅从数据库中检索最后插入的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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