How do I create an index with PHPmyadmin?
I have a database with 5,000 rows of
ID | IP | DATE
Before added data to this table I made id as Primary Key,
The website use this query:
mysql_query("SELECT * FROM users WHERE ip = '$ip'");
I read today that indexes can speed up and performance, and in my case how do i need to add index to IP column,
I am to phpmyadmin and to actions I see "Add unique index" and "Add index" options, Im new in this, appreciate your help, thank you.
Click on the icon that says "index" in the row for ip. (It's the one with the lightening bolt). Don't choose primary key or unique. Just index.
Or you can run a query:
ALTER TABLE `users` ADD INDEX `ip` (`ip`)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With