Jump to content

Closing the row gap in a table


Diegar
 Share

Recommended Posts

Finally figured it out.

			$getIDquery = "SELECT id FROM $user ORDER BY id";			$getID = mysql_query($getIDquery,$msa) or DIE (mysql_error());			$remNum = mysql_numrows($getID) or DIE (mysql_error());			while($downLine <= $remNum) 				{				$setNew = "UPDATE $user SET id = '$line' WHERE id = '$downLine'";				mysql_query($setNew) or DIE (mysql_error());				$downLine++;				$line++;				}

When i removed the row in previous code, $line was the row id number. If row 2 was deleted, '$line = 2' from POST. $downLine = $line + 1Hope that helps anyone with a similar issue.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...