mysqli_result::fetch_objectmysqli_fetch_object
227
Object oriented style
object mysqli_result::fetch_object(
string class_name
=  ="stdClass",
array params);
Procedural style
object mysqli_fetch_object(
mysqli_result result,
string class_name
=  ="stdClass",
array params);
The mysqli_fetch_object will return the current row result set as an object where the attributes of the
object represent the names of the fields found within the result set.
Note that mysqli_fetch_object sets the properties of the object before calling the object constructor.
Parameters
result
Procedural style only: A result set identifier returned by mysqli_query,
mysqli_store_result or mysqli_use_result.
class_name
The name of the class to instantiate, set the properties of and return. If
not specified, a stdClass object is returned.
params
An optional array of parameters to pass to the constructor for
class_name objects.
Return Values
Returns an object with string properties that corresponds to the fetched row or NULL if there are no more
rows in resultset.
Note
Field names returned by this function are case-sensitive.
Note
This function sets NULL fields to the PHP NULL value.
Examples
Example 3.123 Object oriented style
<?php
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$query = "SELECT Name, CountryCode FROM City ORDER by ID DESC LIMIT 50,5";
Pdf form creator - C# PDF Field Edit Library: insert, delete, update pdf form field in C#.net, ASP.NET, MVC, Ajax, WPF
Online C# Tutorial to Insert, Delete and Update Fields in PDF Document
add forms to pdf; pdf form change font size
Pdf form creator - VB.NET PDF Field Edit library: insert, delete, update pdf form field in vb.net, ASP.NET, MVC, Ajax, WPF
How to Insert, Delete and Update Fields in PDF Document with VB.NET Demo Code
change text size pdf form; change font size in pdf fillable form
mysqli_result::fetch_objectmysqli_fetch_object
228
if ($result = $mysqli->query($query)) {
/* fetch object array */
while ($obj = $result->fetch_object()) {
printf ("%s (%s)\n", $obj->Name, $obj->CountryCode);
}
/* free result set */
$result->close();
}
/* close connection */
$mysqli->close();
?>
Example 3.124 Procedural style
<?php
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$query = "SELECT Name, CountryCode FROM City ORDER by ID DESC LIMIT 50,5";
if ($result = mysqli_query($link, $query)) {
/* fetch associative array */
while ($obj = mysqli_fetch_object($result)) {
printf ("%s (%s)\n", $obj->Name, $obj->CountryCode);
}
/* free result set */
mysqli_free_result($result);
}
/* close connection */
mysqli_close($link);
?>
The above examples will output:
Pueblo (USA)
Arvada (USA)
Cape Coral (USA)
Green Bay (USA)
Santa Clara (USA)
See Also
mysqli_fetch_array
mysqli_fetch_assoc
mysqli_fetch_row
C# Create PDF Library SDK to convert PDF from other file formats
Tell Users How to Create New PDF File and Load PDF from Other Files. Free PDF creator SDK for Visual Studio .NET. C# Project: PDF Creator Library DLLs.
changing font in pdf form; allow saving of pdf form
VB.NET Create PDF Library SDK to convert PDF from other file
Free PDF creator SDK library compatible with Visual Basic .NET class and able to create PDF in both .NET WinForms and ASP.NET program.
adding text field to pdf; change font size pdf fillable form
mysqli_result::fetch_rowmysqli_fetch_row
229
mysqli_query
mysqli_data_seek
3.11.10 mysqli_result::fetch_row, mysqli_fetch_row
Copyright 1997-2014 the PHP Documentation Group.
• mysqli_result::fetch_row
mysqli_fetch_row
Get a result row as an enumerated array
Description
Object oriented style
mixed mysqli_result::fetch_row();
Procedural style
mixed mysqli_fetch_row(
mysqli_result result);
Fetches one row of data from the result set and returns it as an enumerated array, where each column is
stored in an array offset starting from 0 (zero). Each subsequent call to this function will return the next row
within the result set, or NULL if there are no more rows.
Parameters
result
Procedural style only: A result set identifier returned by mysqli_query,
mysqli_store_result or mysqli_use_result.
Return Values
mysqli_fetch_row returns an array of strings that corresponds to the fetched row or NULL if there are
no more rows in result set.
Note
This function sets NULL fields to the PHP NULL value.
Examples
Example 3.125 Object oriented style
<?php
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$query = "SELECT Name, CountryCode FROM City ORDER by ID DESC LIMIT 50,5";
if ($result = $mysqli->query($query)) {
C# PDF metadata Library: add, remove, update PDF metadata in C#.
metadata.Keywords = "University, Public, etc."; metadata.Creator = "MS Office String inputFilePath = Program.RootPath + "\\" 1.pdf"; String outputFilePath
acrobat create pdf form; create a form in pdf
VB.NET PDF - How to Add Barcode on PDF Page
Link: Edit URL. Bookmark: Edit Bookmark. Metadata: Edit, Delete Metadata. Form Process. This VB.NET PDF barcode creator add-on, which combines the PDF
can save pdf form data; change font in pdf fillable form
mysqli_result::fetch_rowmysqli_fetch_row
230
/* fetch object array */
while ($row = $result->fetch_row()) {
printf ("%s (%s)\n", $row[0], $row[1]);
}
/* free result set */
$result->close();
}
/* close connection */
$mysqli->close();
?>
Example 3.126 Procedural style
<?php
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$query = "SELECT Name, CountryCode FROM City ORDER by ID DESC LIMIT 50,5";
if ($result = mysqli_query($link, $query)) {
/* fetch associative array */
while ($row = mysqli_fetch_row($result)) {
printf ("%s (%s)\n", $row[0], $row[1]);
}
/* free result set */
mysqli_free_result($result);
}
/* close connection */
mysqli_close($link);
?>
The above examples will output:
Pueblo (USA)
Arvada (USA)
Cape Coral (USA)
Green Bay (USA)
Santa Clara (USA)
See Also
mysqli_fetch_array
mysqli_fetch_assoc
mysqli_fetch_object
mysqli_query
VB.NET PDF metadata library: add, remove, update PDF metadata in
metadata.Keywords = "University, Public, etc." metadata.Creator = "MS Office Dim inputFilePath As String = Program.RootPath + "\\" 1.pdf" Dim outputFilePath
change tab order in pdf form; changing font size in a pdf form
VB.NET PowerPoint: VB Codes to Create Linear and 2D Barcodes on
as 2d barcodes QR Code, Data Matrix, PDF-417, etc Imaging.Basic.dll", "RasterEdge. Imaging.Barcode.Creator.dll" and barcode, which will be in the form of REImage
add fields to pdf form; create a pdf form to fill out
mysqli_result::$field_countmysqli_num_fields
231
mysqli_data_seek
3.11.11 mysqli_result::$field_countmysqli_num_fields
Copyright 1997-2014 the PHP Documentation Group.
• mysqli_result::$field_count
mysqli_num_fields
Get the number of fields in a result
Description
Object oriented style
int 
mysqli_result->field_count ;
Procedural style
int mysqli_num_fields(
mysqli_result result);
Returns the number of fields from specified result set.
Parameters
result
Procedural style only: A result set identifier returned by mysqli_query,
mysqli_store_result or mysqli_use_result.
Return Values
The number of fields from a result set.
Examples
Example 3.127 Object oriented style
<?php
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
if ($result = $mysqli->query("SELECT * FROM City ORDER BY ID LIMIT 1")) {
/* determine number of fields in result set */
$field_cnt = $result->field_count;
printf("Result set has %d fields.\n", $field_cnt);
/* close result set */
$result->close();
}
VB.NET Imaging - Generate Barcode Image in VB.NET
Barcode creator SDK to write & customize ISSN barcode generation in VB.NET imaging project. ITF-14 valid for scanner reading on any pages in a PDF or TIFF
add picture to pdf form; add date to pdf form
C# TIFF: Create Linear and 2D Barcodes on TIFF Document Using C#
TIFF Barcodes Creation. This C# TIFF Barcode Creator Add-on the supported barcode types are listed in the following form. C# TIFF Micro PDF-417 Creating, C# TIFF
chrome save pdf with fields; add image to pdf form
mysqli_result::field_seekmysqli_field_seek
232
/* close connection */
$mysqli->close();
?>
Example 3.128 Procedural style
<?php
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
if ($result = mysqli_query($link, "SELECT * FROM City ORDER BY ID LIMIT 1")) {
/* determine number of fields in result set */
$field_cnt = mysqli_num_fields($result);
printf("Result set has %d fields.\n", $field_cnt);
/* close result set */
mysqli_free_result($result);
}
/* close connection */
mysqli_close($link);
?>
The above examples will output:
Result set has 5 fields.
See Also
mysqli_fetch_field
3.11.12 mysqli_result::field_seekmysqli_field_seek
Copyright 1997-2014 the PHP Documentation Group.
• mysqli_result::field_seek
mysqli_field_seek
Set result pointer to a specified field offset
Description
Object oriented style
bool mysqli_result::field_seek(
Create Thumbnail in Web Image Viewer | Online Tutorials
Go to the toolbar: Select "Thumbnail Creator" & activate RasterEdge OCR Engine; PDF Reading; Encode & Decode JBIG Twain Scanning; DICOM Reading; Form Recognition
pdf form save in reader; best way to create pdf forms
VB Imaging - Micro PDF 417 VB Barcode Generation
in a programming way. Following are the main features of this VB.NET Micro PDF 417 barcode creator SDK. The Barcode Creator Add-on
best program to create pdf forms; add an image to a pdf form
mysqli_result::field_seekmysqli_field_seek
233
int fieldnr);
Procedural style
bool mysqli_field_seek(
mysqli_result result,
int fieldnr);
Sets the field cursor to the given offset. The next call to mysqli_fetch_field will retrieve the field
definition of the column associated with that offset.
Note
To seek to the beginning of a row, pass an offset value of zero.
Parameters
result
Procedural style only: A result set identifier returned by mysqli_query,
mysqli_store_result or mysqli_use_result.
fieldnr
The field number. This value must be in the range from 0 to number of
fields - 1.
Return Values
Returns TRUE on success or FALSE on failure.
Examples
Example 3.129 Object oriented style
<?php
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$query = "SELECT Name, SurfaceArea from Country ORDER BY Code LIMIT 5";
if ($result = $mysqli->query($query)) {
/* Get field information for 2nd column */
$result->field_seek(1);
$finfo = $result->fetch_field();
printf("Name:     %s\n", $finfo->name);
printf("Table:    %s\n", $finfo->table);
printf("max. Len: %d\n", $finfo->max_length);
printf("Flags:    %d\n", $finfo->flags);
printf("Type:     %d\n\n", $finfo->type);
$result->close();
}
/* close connection */
$mysqli->close();
?>
mysqli_result::freemysqli_free_result
234
Example 3.130 Procedural style
<?php
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$query = "SELECT Name, SurfaceArea from Country ORDER BY Code LIMIT 5";
if ($result = mysqli_query($link, $query)) {
/* Get field information for 2nd column */
mysqli_field_seek($result, 1);
$finfo = mysqli_fetch_field($result);
printf("Name:     %s\n", $finfo->name);
printf("Table:    %s\n", $finfo->table);
printf("max. Len: %d\n", $finfo->max_length);
printf("Flags:    %d\n", $finfo->flags);
printf("Type:     %d\n\n", $finfo->type);
mysqli_free_result($result);
}
/* close connection */
mysqli_close($link);
?>
The above examples will output:
Name:     SurfaceArea
Table:    Country
max. Len: 10
Flags:    32769
Type:     4
See Also
mysqli_fetch_field
3.11.13 mysqli_result::free, mysqli_free_result
Copyright 1997-2014 the PHP Documentation Group.
• mysqli_result::free
mysqli_free_result
Frees the memory associated with a result
mysqli_result::$lengthsmysqli_fetch_lengths
235
Description
Object oriented style
void mysqli_result::free();
void mysqli_result::close();
void mysqli_result::free_result();
Procedural style
void mysqli_free_result(
mysqli_result result);
Frees the memory associated with the result.
Note
You should always free your result with mysqli_free_result, when your result
object is not needed anymore.
Parameters
result
Procedural style only: A result set identifier returned by mysqli_query,
mysqli_store_result or mysqli_use_result.
Return Values
No value is returned.
See Also
mysqli_query
mysqli_stmt_store_result
mysqli_store_result
mysqli_use_result
3.11.14 mysqli_result::$lengthsmysqli_fetch_lengths
Copyright 1997-2014 the PHP Documentation Group.
• mysqli_result::$lengths
mysqli_fetch_lengths
Returns the lengths of the columns of the current row in the result set
Description
Object oriented style
array 
mysqli_result->lengths ;
Procedural style
array mysqli_fetch_lengths(
mysqli_result result);
mysqli_result::$lengthsmysqli_fetch_lengths
236
The mysqli_fetch_lengths function returns an array containing the lengths of every column of the
current row within the result set.
Parameters
result
Procedural style only: A result set identifier returned by mysqli_query,
mysqli_store_result or mysqli_use_result.
Return Values
An array of integers representing the size of each column (not including any terminating null characters).
FALSE if an error occurred.
mysqli_fetch_lengths is valid only for the current row of the result set. It returns FALSE if you call it
before calling mysqli_fetch_row/array/object or after retrieving all rows in the result.
Examples
Example 3.131 Object oriented style
<?php
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$query = "SELECT * from Country ORDER BY Code LIMIT 1";
if ($result = $mysqli->query($query)) {
$row = $result->fetch_row();
/* display column lengths */
foreach ($result->lengths as $i => $val) {
printf("Field %2d has Length %2d\n", $i+1, $val);
}
$result->close();
}
/* close connection */
$mysqli->close();
?>
Example 3.132 Procedural style
<?php
$link = mysqli_connect("localhost", "my_user", "my_password", "world");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
Documents you may be interested
Documents you may be interested