0

I am uploading csv file to mysql database.

Need to check manually check eg.number of row is match with database table column.

1.how to get table's column count in cakephp? 2.No table data ,i want only column count in table.

Any help? Thanks in advance!

Balan
  • 421
  • 6
  • 12
Linn
  • 1
  • 1
  • Use the solution provided in the most upvoted answer in the duplicate topic as a raw query. – Shadow Oct 20 '16 at 10:56

1 Answers1

1

You can access protected objects value _schema

$columnCount = count($this->Site->_schema);

Site is model that You are interested in

Bogdan Kuštan
  • 5,427
  • 1
  • 21
  • 30