Oracle 5.0 Reference Manual page 2306

Table of Contents

Advertisement

This function is deprecated. It is preferable to use
FROM table [LIKE 'name']
Parameters
database_name
table_name
link_identifier
Return Values
A result pointer resource on success, or
The returned result can be used with mysql_field_flags, mysql_field_len,
and mysql_field_type.
mysql_field_name
Examples
Example 20.61. Alternate to deprecated
<?php
$result = mysql_query("SHOW COLUMNS FROM sometable");
if (!$result) {
echo 'Could not run query: ' . mysql_error();
exit;
}
if (mysql_num_rows($result) > 0) {
while ($row = mysql_fetch_assoc($result)) {
print_r($row);
}
}
?>
The above example will output something similar to:
Array
(
[Field] => id
[Type] => int(7)
[Null] =>
[Key] => PRI
[Default] =>
[Extra] => auto_increment
)
Array
(
[Field] => email
[Type] => varchar(100)
[Null] =>
[Key] =>
[Default] =>
[Extra] =>
)
Notes
Original MySQL API (Mysql)
mysql_query
statement instead.
The name of the database that's being queried.
The name of the table that's being queried.
The MySQL connection. If the link identifier is not specified, the
last link opened by
is found, it will try to create one as if
with no arguments. If no connection is found or established, an
level error is generated.
E_WARNING
on failure.
FALSE
mysql_list_fields
2286
to issue an SQL
is assumed. If no such link
mysql_connect
mysql_connect
SHOW COLUMNS
was called

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 5.0 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Mysql 5.0

Table of Contents