1

Could anybody give me a little advice as to how I would search the table names from 1 database within a SQL PHP query.

At present this is my not working code.

I have a database named classified with a list of genres ie computers clothes cars music etc etc. Within each table is. I'd name price etc etc. I have all that processing correctly and I can use the data in my webpage but I'm a little stuck on the searching. Here's my query code:

Select * from $dbname WHERE $results LIKE '%$search%'
halfer
  • 19,824
  • 17
  • 99
  • 186
russbaker2016
  • 99
  • 1
  • 14

2 Answers2

1

Try this:

SELECT
    * 
FROM
    sys.tables 
WHERE
    name
LIKE
    '%product%'
joe
  • 31
  • 8
0

If you are trying to perform a full database search to find out a data you can easily use MySql workbench or PhpMyAdmin to search data from your database. Also there are many open posts on StackOverflow regarding this issues. Please read the answer from this question.

Shahriar63
  • 58
  • 1
  • 8