mysql_fetch_lengths()

It returns the length of the contents of each field in a row.

Example

<?php
mysql_connect(“localhost”, “root”, “password”) or die(mysql_error());
mysql_select_db(“database_name”);
echo “<pre>”;
print_r(mysql_fetch_lengths(mysql_query(“SELECT * FROM users”)));
?>

Share