Title: PHP Variable Table Length
Last modified: September 1, 2016

---

# PHP Variable Table Length

 *  [HumbleApprentice](https://wordpress.org/support/users/humbleapprentice/)
 * (@humbleapprentice)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/php-variable-table-length/)
 * So there’s a table that is holding a few strings. However, each time a string
   is added, the table grows. I want to retrieve the total length of the table, 
   or find out how many variables are in said table, and convert it into an integer
   to use in a for loop. Thoughts?
 * Code so far, tell me if I have any other issues, hopefully you all can understand
   what I am trying to do. Using WooCommerce store on a MySQL database. And the 
   data is being stored in my post meta.
 * for($i = 0; $i < *length of team_name table*; $i = $i + 1)
    { if ( team_name 
   = get_post_meta( $i, ‘Team Name’, true )) { wc_add_notice( __( ‘Please enter 
   a new team name.’ ), ‘error’ ); break; } }

The topic ‘PHP Variable Table Length’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [HumbleApprentice](https://wordpress.org/support/users/humbleapprentice/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/php-variable-table-length/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
