You can leave your sort column equal to NULL by default. The only thing you need is a little smarter query. For instance:
select *
from something
order by ifnull(sort, id)
More Related Contents:
- Can you add an if statement in ORDER BY?
- Prevent InnoDB auto increment ON DUPLICATE KEY
- PHP mySQL – Insert new record into table with auto-increment on primary key
- How to sort MYSQL fulltext search results by relevancy
- timestamp within a form [closed]
- how to select only one value sql
- Save the data into a database and return another value from database using PHP
- Math Symbol From Mysql To HTML? [closed]
- How to store repeating dates keeping in mind Daylight Savings Time
- Using a .php file to generate a MySQL dump
- Insert Blobs in MySql databases with php
- Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in [duplicate]
- PDO with INSERT INTO through prepared statements [closed]
- How do I execute PHP that is stored in a MySQL database?
- Error while sending QUERY packet
- How to sort rows of HTML table that are called from MySQL
- PDO fetch one column from table into 1-dimensional array
- php file upload, how to restrict file upload type
- Get all mysql selected rows into an array
- Select from mysql table WHERE field=’$array’?
- Sort multidimensional array by date column, then use other column values if dates are the same
- MySQL error when inserting data containing apostrophes (single quotes)?
- php password_verify() hash and pass won’t match
- MySQL query using an array [duplicate]
- Using MySQL’s TIMESTAMP vs storing timestamps directly
- mysqli prepared statement num_rows returns 0 while query returns greater than 0 [duplicate]
- array_push() vs. $array[] = …. Which is fastest? [duplicate]
- using the browser prompt to download a file
- MySqli Commands out of sync; you can’t run this command now [duplicate]
- Save array in mysql database