It closes MySQL connection
Example
<?php
$conn = mysql_connect(‘localhost’, ‘root’, ‘password’);
echo mysql_client_encoding($conn);
mysql_close($conn);
?>
It closes MySQL connection
Example
<?php
$conn = mysql_connect(‘localhost’, ‘root’, ‘password’);
echo mysql_client_encoding($conn);
mysql_close($conn);
?>
It returns the name of the character set for the current connection
Example
<?php
$conn = mysql_connect(‘localhost’, ‘root’, ‘password’);
echo mysql_client_encoding($conn);
?>
It returns the number of affected rows in the previous MySQL operation.
Example
<?php
$con = mysql_connect(“localhost”,”root”,”password”) or die( mysql_error());
mysql_select_db(“databse_name”);
mysql_query(“DELETE FROM table_name WHERE id = 1”);
echo mysql_affected_rows();
mysql_close($con);
?>
It reads the next entry in a ZIP file
Example
<?php
$zp = zip_open(“test.zip”);
while ($zipEntry = zip_read($zp)){
echo “Actuall file name -” . zip_entry_name($zipEntry);
if (zip_entry_open($zp, $zipEntry)){
zip_entry_close($zipEntry);
}
}
zip_close($zp);
?>
It opens a ZIP file
Example
<?php
$zp = zip_open(“test.zip”);
zip_close($zp);
?>
It reads from an open entry in the ZIP file
Example
<?php
$zp = zip_open(“test.zip”);
while ($zipEntry = zip_read($zp)){
echo “Actuall file name -” . zip_entry_name($zipEntry);
if (zip_entry_open($zp, $zipEntry)){
zip_entry_close($zipEntry);
}
}
zip_close($zp);
?>
Output
Actuall file name -test.php
It opens an entry in the ZIP file for reading
Example
<?php
$zp = zip_open(“test.zip”);
while ($zipEntry = zip_read($zp)){
echo “Actuall file name -” . zip_entry_name($zipEntry);
if (zip_entry_open($zp, $zipEntry)){
zip_entry_close($zipEntry);
}
}
zip_close($zp);
?>
It returns the name of an entry in the ZIP file
Example
<?php
$zp = zip_open(“test.zip”);
while ($zipEntry = zip_read($zp)){
echo “Actuall file name -” . zip_entry_name($zipEntry);
if (zip_entry_open($zp, $zipEntry)){
zip_entry_close($zipEntry);
}
}
zip_close($zp);
?>
Output
Actuall file name -test.php
It returns the actual file size of an entry in the ZIP file
Example
<?php
$zp = zip_open(“test.zip”);
while ($zipEntry = zip_read($zp)){
echo “Actaull file size -” . zip_entry_filesize($zipEntry);
if (zip_entry_open($zp, $zipEntry)){
zip_entry_close($zipEntry);
}
}
zip_close($zp);
?>
Output
Actaull file size -136
It returns the compression method of a directory entry
Example
<?php
$zp = zip_open(“test.zip”);
while ($zipEntry = zip_read($zp)){
echo “Compression Method -” . zip_entry_compressionmethod($zipEntry);
if (zip_entry_open($zp, $zipEntry)){
zip_entry_close($zipEntry);
}
}
zip_close($zp);
?>
Output
Compression Method -deflated