Title: Create field as integer
Last modified: August 30, 2016

---

# Create field as integer

 *  [johnhedge](https://wordpress.org/support/users/johnhedge/)
 * (@johnhedge)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/create-field-as-integer/)
 * Hi,
    I’m a noob! I’m trying to order by +’ve and -‘ve numbers but it seems the
   db is treating them as a string, I think. I then tried to change the field type
   but integer doesn’t seem to be on offer. Please advise. TIA John
 * [https://wordpress.org/plugins/participants-database/](https://wordpress.org/plugins/participants-database/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [xnau webdesign](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/create-field-as-integer/#post-6646833)
 * You have to alter the database directly to do this. Open your database using 
   PHPMyAdmin or a similar database tool. Change the “data type” of the field you
   want to sort numerically to a numeric type, such as INTEGER. Be aware that if
   there is any non-numeric content in that column, it will be lost.
 * Now, when you sort by that field, it will sort numerically instead of alphabetically.
 *  Thread Starter [johnhedge](https://wordpress.org/support/users/johnhedge/)
 * (@johnhedge)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/create-field-as-integer/#post-6646837)
 * So if I enter -3 in the field through the admin app of Participants Database 
   which is probably taken as a string in the web page it will be understood by 
   MySQL as an Integer?
 *  Plugin Author [xnau webdesign](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/create-field-as-integer/#post-6646840)
 * Yes, the database will only store integers in that column, so any strings that
   can be interpreted as integers are converted to integers.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Create field as integer’ is closed to new replies.

 * ![](https://ps.w.org/participants-database/assets/icon-256x256.jpg?rev=1389807)
 * [Participants Database](https://wordpress.org/plugins/participants-database/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/participants-database/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/participants-database/)
 * [Active Topics](https://wordpress.org/support/plugin/participants-database/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/participants-database/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/participants-database/reviews/)

## Tags

 * [Numbers](https://wordpress.org/support/topic-tag/numbers/)
 * [string](https://wordpress.org/support/topic-tag/string/)

 * 3 replies
 * 2 participants
 * Last reply from: [xnau webdesign](https://wordpress.org/support/users/xnau/)
 * Last activity: [10 years, 6 months ago](https://wordpress.org/support/topic/create-field-as-integer/#post-6646840)
 * Status: not resolved