J
|
jmclain 5/2/2014 |
I have an application form and i want to display the application ID to user while they fill the form. So it needs to check the last application ID and add 1 on that. Since it is a single user database, there shouldn't be a duplication issue. I would appreciate it if anybody here knew the trick. Thanks
$sql="select top 1 APP_ID from dbo.YOUR_APP_TABLE order by APP_ID desc"; //Query to get the last ID number in the table |
F
|
F5447 5/3/2014 |
I have an application form and i want to display the application ID to user while they fill the form. So it needs to check the last application ID and add 1 on that. Since it is a single user database, there shouldn't be a duplication issue. I would appreciate it if anybody here knew the trick. Thanks
|
B
|
bijayapun author 5/3/2014 |
Probably a bunch of ways to approach this -- but you could do the following. Within Visual Editor, insert PHP code snippet - somewhere on your page. Now insert something like this for your code. Please note - this is an example and change as needed. $sql="select top 1 APP_ID from dbo.YOUR_APP_TABLE order by APP_ID desc"; //Query to get the last ID number in the table
|
J
|
jmclain 5/3/2014 |
Thanks for the information. I managed to display the APP_ID through php snippet. However, i want to give that value to field so that it will be submitted too. Lookup table gave me the next id using max(APP_ID)+1 however it comes with drop down box. I wanted to show read only value of APP_ID.
$sql="select top 1 APP_ID from dbo.YOUR_APP_TABLE order by APP_ID desc"; //Query to get the last ID number in the table
|