Results in the form of url and not the name of the MySQL table

0

The problem is that when I do a search, I get a result but it is not visualized in the way I expect.

When I make the query on the local server, it gives me the expected result:

SELECT TABLE_NAME FROM 'INFORMATION_SCHEMA'.'TABLES' WHERE TABLE_NAME = 'pagos';
+------------+
| TABLE_NAME |
+------------+
| pagos      |
+------------+
1 row in set (0.66 sec)

The same query now in phpMyAdmin where I have my site:

SELECT TABLE_NAME FROM 'INFORMATION_SCHEMA'.'TABLES' WHERE TABLE_NAME = 'pagos'
+----------------------------------------------------------------+
| TABLE_NAME                                                     |
+----------------------------------------------------------------+
| sql.php?table=pagos&token=78563b6e7a9ac860275976a5c2c841f5 |
+----------------------------------------------------------------+

The query is well done because obviously it gives me the same result but I do not understand why the url throws at me and not the name of the table.

The following image exemplifies the error that I have, not only in the column TABLES.TABLE_NAME

This same problem I have in the other tables

INFORMATION_SCHEMA.TABLES
INFORMATION_SCHEMA.COLUMNS

I do not know if it's a serious problem, or very simple, but I've been slow to find a solution, so much so that I'm thinking about deleting the entire database and creating another one, maybe that will solve it. But it is not so easy for me to take the simple path and stay with the doubt of the possible solution.

I hope you can support me as on other occasions.

Thanks in advance

    
asked by Enrique Navarro 12.06.2018 в 10:22
source

1 answer

0

The result you are getting may be due to a bug in PHPMyAdmin, or because it is not updated, or to hosting restrictions. The truth is that a query that reveals the connection token could be dangerous.

I would propose the following alternatives:

Option 1

If you're only interested in the name of the table:

SHOW TABLES LIKE '%prueba%';

It will bring you all the tables that contain the word prueba in the name.

Option 2

If you are interested in more information about the table:

SHOW TABLE STATUS WHERE name='prueba';

O:

SHOW TABLE STATUS WHERE name LIKE '%prueba%';

This query will bring you more information about the table. Here you can see a more detailed explanation about it .

Note that none of these queries reveal the internal tables of the handler, which makes them safer than the use of INFORMATION_SCHEMA .

Option 3

If you are still interested in using the query as you originally had it. You could:

  • a. Create a script (using PHP or the server language you are using), launch the query from there and show the results where you need them.

  • b. Contact the technical service of the hosting where the database is hosted. It may be necessary to update the version of PHPMyAdmin they have.

  • c. You could also try a different database, if you had one, to debug it is not a problem in the database itself.

answered by 12.06.2018 в 12:59