I have the following code:
$GetUID = $c->query("SELECT UserUID FROM dbo.Users_Master ORDER BY UserID DESC");
$UserUniqueID = $GetUID->fetch(PDO::FETCH_ASSOC);
$UUID = $UserUniqueID['UserUID'];
$NewUUID = $UUID + 1;
This is successfully working, but the problem is something with my query.
It is always entering 12 into my database.
I went to the Microsoft SQL query window and entered:
USE UserData;
SELECT UserUID FROM dbo.Users_Master ORDER BY UserID DESC
and it returned:
11, 17, 15, 19, 16, 18, 10, 13, 12, 14, 3
Which is not exactly ordering by the highest to lowest.
I then went on using:
USE UserData;
SELECT UserUID FROM dbo.Users_Master ORDER BY UserID ASC
Which returned:
3, 14, 12, 13, 10, 18, 16, 19, 15, 17, 11
I want to obtain the higest UserUID and +1 to it.. WHy is my code selecting 11 all the time?
UserID? Is itINTor something else?