mysql_tablename
mysql_tablename
Get table name of field
Waarschuwing: >
SHOW TABLES
**mysql_tablename** resource $result int $i
Retrieves the table name from a .
result
This function is deprecated. It is preferable to use
to issue an SQL statement instead.
mysql_query``SHOW TABLES [FROM db_name] [LIKE 'pattern']
result
A result pointer that's returned from
.
resource``mysql_list_tables
iThe integer index (row/table number)
The name of the table on successreturn.falseforfailure.
Use the function to
traverse this result pointer, or any function for result tables,
such as .
mysql_tablename``mysql_fetch_array
Voorbeeld: example
<?php
mysql_connect("localhost", "mysql_user", "mysql_password");
$result = mysql_list_tables("mydb");
$num_rows = mysql_num_rows($result);
for ($i = 0; $i < $num_rows; $i++) {
echo "Table: ", mysql_tablename($result, $i), "\n";
}
mysql_free_result($result);
?>
Opmerking: > The function may be used to determine the number of tables in the result pointer.
mysql_num_rows
mysql_list_tables``mysql_field_table``mysql_db_name