fetching tables name from database by query in php file [duplicate] - php

This question already has answers here:
Select data from "show tables" MySQL query
(13 answers)
Closed 9 years ago.
Blockquote
sir i want to fetch all the table's name and information about all table as total no. of field etc with the help of single query in php file .i am using phpmyadmin as mysql please tell me how can i do it.
thanks

select * from information_schema.TABLES
You can also check :
select * from information_schema.COLUMNS

Related

PHP script to copy mysql column to another table [duplicate]

This question already has answers here:
php and mysql copy record from one table to another
(4 answers)
Closed 3 years ago.
Is there any easy way to copy one a column in a table to another table without changing the order ?
I am a beginner here. I would be much thankful to you if you could supply in depth answer.
I think this query can help you out
INSERT INTO second_table SELECT * FROM first_table WHERE id IN(1,2,3,4...n)

MySQL Show Databases With Where Condition [duplicate]

This question already has answers here:
"Show databases" with condition
(4 answers)
Closed 5 years ago.
Is there a way to show a list of databases by condition?
Show databases WHERE table_name ='?' AND column_name = '?';
BEST BET:
Just itterate through all the databases, but if your trying to find a specific table why not just do this SHOW TABLES LIKE 'my_table_numer_%'; That will select a table with a begging part followed by a wild card text.

How do I display the 'field' in mysql on website as table PHP? [duplicate]

This question already has answers here:
Get table column names in MySQL?
(19 answers)
Closed 6 years ago.
how do I display mysql "field" column only on my website using PHP and SQL? I don't want to show other data except the "field" column in a table.
Because I trying to do adding,editing and deleting of the "field" through my own website admin portal instead of login to phpmyadmin to do it. Appreciate if have advice on this too.
Thanks[please refer to the picture below for easier understand what I'm asking]
https://i.stack.imgur.com/WVGQl.png
Your query should be this:
SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = '<database_name>' AND TABLE_NAME = '<table_name>';

Can I use get the just insert table row id, from mysql_query? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
PHP: how to get last inserted ID of a table?
I use mysql_query() in PHP to insert a new record in my Database.
It will auto generate a row, with a user Id, can I use the result to get that Id?
mysql_insert_id()
Have you considered upgrading to PDO?

how i can get the ID generated in the last query by php with sql server [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
How to get Insert id in MSSQL in PHP?
how i can get the ID generated in the last query by php with sql server, i know how do it by mysql
mysql_inserted_id but with sql server i cant pleass help
You can try ##Identity.
SELECT ID AS LastID FROM Persons WHERE ID = ##Identity;

Categories