I try it on phpmyAdmin it work! but when I try it on SQLI mysqli_query isn't they said You have an error in your SQL syntax. what I do something worng plese halp me. $q = "DELETE FROM plants WHERE pro_id='$pro_id'; SET @autoid :=0; Update plants set pro_id='$pro_id' = @autoid :=(@autoid+1); alter table plants Auto_increment =1"; $result = mysqli_query($dbcon,$q);
Warning: #1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'. how to type code then ?
Real Challenge. Same Problems Every Time We know that we can "always" reset the auto-increment column BUT eventually, you will have the same problem again and again. Question. Can you make an auto-reset auto increment? FOR EXAMPLE ID NAME 1 BOB 2 JOHN 3 SERA #1 delete some users ID NAME 1 BOB 3 SERA #2 add a new user 1 BOB 3 SERA 4 MIKE use the manual auto-increment reset Then the same issue happens again. (See for example) Is there any way that the database can auto-reset the auto-increment so the problem will not happen again?
i got this error Pleases Help Some:( Error SQL query: update loginapp set id = @autoid := (@autoid+1) MySQL said: Documentation #1146 - Table 'loginapp.loginapp' doesn't exist
$query= "DELETE FROM ".$tableName." WHERE ".$conditionData SET @autoid :=0; UPDATE live SET id = @autoid := @autoid+1; ALTER TABLE live AUTO_INCREMENT = 1; any one pls correct it
Saved me the stress of setting new auto increment and importing again a record of over 900K. Thank you. Thank you! Indeed learning never stops.
set @autoid :=0;
update employee set id = @autoid := (@autoid+1);
alter table employee Auto_Increment = 1;
Thank You much. 👍
Thank you brother
Thanks a lot
thank you
you saved
If i use this statement with servlet that would work ? After deleting specific data ?
thank you so much for this tuto i can't believe that you released this life saver 6 years ago .
No worries!
thanks excellent video- i used the first formula to change the current records ensure the new records created would follow that number sequence
Glad it helped!
Thank you so much sir for this video.
Merci, j'ai galéré un moment avant de tomber sur ta solution
Will the row being in auto increment and correct serial numbers?
thank you for your answer.big helpful for this video.
thank u so much sir...very helpful video
thanks allot sir ...
this is very helpfulllllllllllllllllllllllllllllllllllllllllllllll
greeting from Peru THANK YOU
thank you! Greetings from Venezuela
tnx homey u saved ma time
Thank you for helping me!
thank you, it work without a hitch
thank you! Greetings from Panama
fine, but how can you do it automatically for a project, for example?
The same procedure you have implement, just change the connection string according to your remote database thanks
thanks sir
Thank You Sir You Reduced My Stress 💗💖🥺
No worries !
thanks for the help
It's Working! Thank you so much!
thank you
Thank you! Helped so much!
Thanks alot to give such solution..
I have done as you instructed and then after last alter command I deleted the row and again inserted row but the same problem is coming
It works 100% please check your datatypes and the column contains primay key or not..
Thank you! Stay safe
Very Helpful to me......
THANKS
Absolutely usefull, thanks a lot mate!
Thankz. Its worked.
Thank you very much for this video.
Thanks mate !
you don't use DBCC CHECKIDENT(tableName, RESEED, 0) ?
it would be very usefull if you include the code in the description so as to copy paste it
Big Thanks from England
Thanks mate !
Great job
thank you
Thanks indeed!
thanks very much
No worries!
Thank you, lifesafer!
Thank you soo much
pls tell me agr mai koi bhi record del krta hun toh automatically ids update hojaye aisa kuch bta sakte ho
Nice thank you Sir
Thanks mate !
Thank you sir
thank you sir
thank you very much very helpful :)
No worries mate!
nice !
Thank you!
u r welcome mate !
thankyou bro
Thanks mate !
Thank you so much buddy
Thanks man it helped!
Thanks mate ..!
informative
SET @autoid :=0;
UPDATE table_name SET id = @autoid := (@autoid+1);
ALTER TABLE table_name Auto_Increment = 1;
better~❤
Please I want to keep old records and restart auto ID 1. How do I do that ?
How to make id restart after deleting middle record in C# with MySQL.
What if this table has relation with other. Won't it going to be a big mess.
Sir in my database, subs_id always start with serial number 0, so the next entry data could not be filled, what should I do sir???
Stop the Illegal War in the name of Peaceful War worldwide. Control your Americal. Mike 😕
thank you :)
thanks mate :)
thanks xoxo :D
Thanks mate!
I try it on phpmyAdmin it work! but when I try it on SQLI mysqli_query isn't they said You have an error in your SQL syntax.
what I do something worng plese halp me.
$q = "DELETE FROM plants WHERE pro_id='$pro_id';
SET @autoid :=0;
Update plants set pro_id='$pro_id' = @autoid :=(@autoid+1);
alter table plants Auto_increment =1";
$result = mysqli_query($dbcon,$q);
any solution
Thankyou :)
thanks mate !
How to use this query in php.?
any answer
Thanks (Y)
Still I m having same problem
Warning: #1287 Setting user variables within expressions is deprecated and will be removed in a future release. Consider alternatives: 'SET variable=expression, ...', or 'SELECT expression(s) INTO variables(s)'.
how to type code then ?
how to execute this in c#?
How to restore posts from phpmyadmin after being deleted permanently from trash?
how about in sqlite? please help me
Real Challenge. Same Problems Every Time
We know that we can "always" reset the auto-increment column
BUT
eventually, you will have the same problem again and again.
Question.
Can you make an auto-reset auto increment?
FOR EXAMPLE
ID NAME
1 BOB
2 JOHN
3 SERA
#1 delete some users
ID NAME
1 BOB
3 SERA
#2 add a new user
1 BOB
3 SERA
4 MIKE
use the manual auto-increment reset
Then the same issue happens again. (See for example)
Is there any way that the database can auto-reset the auto-increment so the problem will not happen again?
did you get the answer yet? if you do, can you please share it.....
@@muhammadshahrukhsiddiqui8155 I still can't figure it out how. Sorry
@Gustavo Saiki ik, but how
set @autoid :=0;
update TABLE_NAME set id = @autoid := (@autoid+1);
alter table TABLE_NAME Auto_Increment = 1;
i got this error Pleases Help Some:(
Error
SQL query:
update loginapp set id = @autoid := (@autoid+1)
MySQL said: Documentation
#1146 - Table 'loginapp.loginapp' doesn't exist
$query= "DELETE FROM ".$tableName." WHERE ".$conditionData SET @autoid :=0; UPDATE live SET id = @autoid := @autoid+1; ALTER TABLE live AUTO_INCREMENT = 1;
any one pls correct it
Thanks a lot
Thanks mate !
Thank you !!