Usage of php mysql_field_type() function

怪我咯
Release: 2023-03-12 22:12:01
Original
1538 people have browsed it

This article mainly introduces the usage of the mysql_field_type() function in PHP, and analyzes in more detail the method of using the mysql_field_type() function to obtain the specified field type, which is PHP+ Very practical skills in MySQL programming, friends in need can refer to

This article explains the usage of the mysql_field_type() function in PHP with examples. Share it with everyone for your reference. The details are as follows:

Definition and usage: mysql_field_type() function returns the type of the specified field in the result set. If successful, it returns the type of the specified field. If it fails, it returns false.

Syntax: mysql_field_type(data,field_offset)

Parameter Description
data Required, The data pointer to use, which is the result returned from mysql_query().
field_offset Required, indicating which field to start from Return, 0 indicates the first field.

## The code is as follows:

<?php 
mysql_connect("localhost","root",""); 
mysql_select_db("mydatabase"); 
$query = "SELECT id as ID, title FROM mytable ORDER BY title"; 
$result = mysql_query($query); 
$row = mysql_fetch_row($result); 
echo mysql_field_type($result, 0); 
?>
Copy after login

The above is the detailed content of Usage of php mysql_field_type() function. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!