★ wanayoo — archive 1999 http://www.php.net/manual/function.mysql-tablename.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to MySQL
Quick Reference
MySQL
* mysql_affected_rows
* mysql_change_user
* mysql_close
* mysql_connect
* mysql_create_db
* mysql_data_seek
* mysql_db_query
* mysql_drop_db
* mysql_errno
* mysql_error
* mysql_fetch_array
* mysql_fetch_field
* mysql_fetch_lengths
* mysql_fetch_object
* mysql_fetch_row
* mysql_field_name
* mysql_field_seek
* mysql_field_table
* mysql_field_type
* mysql_field_flags
* mysql_field_len
* mysql_free_result
* mysql_insert_id
* mysql_list_fields
* mysql_list_dbs
* mysql_list_tables
* mysql_num_fields
* mysql_num_rows
* mysql_pconnect
* mysql_query
* mysql_result
* mysql_select_db
* mysql_tablename
Manual: mysql_tablename
View the source code for this pageSearch the site



Previous page
 mysql_select_db
Network 
Next page


mysql_tablename

mysql_tablename -- Get table name of field

Description

string mysql_tablename(int result, int i);

mysql_tablename() takes a result pointer returned by the mysql_list_tables() function as well as an integer index and returns the name of a table. The mysql_num_rows() function may be used to determine the number of tables in the result pointer.

Example 1. Mysql_tablename() Example

  1 
  2 <?php 
  3 mysql_connect ("localhost:3306");
  4 $result = mysql_list_tables ("wisconsin");
  5 $i = 0;
  6 while ($i < mysql_num_rows ($result)) {
  7     $tb_names[$i] = mysql_tablename ($result, $i);
  8     echo $tb_names[$i] . "<BR>";
  9     $i++;
 10 }
 11 ?>
 12       


User Contributed Notes: mysql_tablename


jani.vahasoyrinki
19-Sep-1999 06:07
I noticed that there is ready build function mysql_dbname (atleast in php4). Very useful, but not in the list in this documentation. Works like mysql_tablename.


kevin@mysql.fury.com
26-Sep-1999 03:07
Actually, it seems that mysql_dbname was the Right Way in php2, but it's been depreciated to the point that it's not in the documentation any more (though a reference to it is made in mysql_tablename). Basically, you should just use mysql_tablename wherever you'd want to use mysql_dbname, as both result pointers have the same format.


ajung@sz-sb.de
13-Mar-2000 07:31
One expects to use mysql_dbname in combination with mysql_list_dbs(). This is not a very clever naming convention ! Andreas


 About Notes


Previous page
 mysql_select_db
Network 
Next page



Site Statistics


Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.