WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Mobile Dev World
Return a string containing the last error for the current session

curl_error

(PHP 4 >= 4.0.3, PHP 5)

curl_errorReturn a string containing the last error for the current session

Description

string curl_error ( resource $ch )

Returns a clear text error message for the last cURL operation.

Parameters

ch

A cURL handle returned by curl_init().

Return Values

Returns the error message or '' (the empty string) if no error occurred.

Examples

Example #1 curl_error() example

<?php
// Create a curl handle to a non-existing location
$ch curl_init('http://404.php.net/');
curl_setopt($chCURLOPT_RETURNTRANSFERtrue);

if(
curl_exec($ch) === false)
{
    echo 
'Curl error: ' curl_error($ch);
}
else
{
    echo 
'Operation completed without any errors';
}

// Close handle
curl_close($ch);
?>

See Also


How to use your own 404 Error file from .htaccess.
Categories : Apache, Web Servers
[PHP5] aDB PDO LIKE Database Abstraction. Switch easily from one db server to another, strong errors management, manage transactions, queries preparation and more.
Categories : PHP, PHP Classes, Databases, MS SQL Server, MySQL
Bounce, Bounce mail on errors.
Categories : Email



PHP Based Apache + Mysql Error Log Parser
Categories : PHP, PHP Classes, Apache, MySQL, Log Files
Example of function to send out email if error occurs
Categories : PHP, Email, Debugging, Errors and Logging
MySql error reporting, error messages in mysql.
Categories : MySQL, PHP, Databases
A database abstraction layer for the PHP 3.0 ODBC module. It supports persistent connections, fetching rows into arrays, prepare/execute (variable binding) and has a new and improved error interface.
Categories : Databases, PHP, Complete Programs
CheckDateInput - Date Checking / Validation functions - with error reporting, multiple separator support, and y2k fix. Choose either own code or php checkdate function version.
Categories : Date Time, PHP
A simple function to prevent undefined $_POST/$_GET/$_SESSION variable errors
Categories : PHP, Variables, Errors and Logging
This is the simpliest and the most secure error-free code to get the user's IP address and his host ( domain name ). the @ in the beginning of the function will force PHP not to output any error messages, so it is very useful for sendmail forms
Categories : PHP
AITSH Errorbot
Categories : Complete Programs, HTML and PHP, HTTP
How to find the error meaning of an Informix error number.
Categories : Databases, Informix, Debugging
Simple PHP/MySQL Database Abstraction Layer. Returns queries as 1 or 2 dimensional array's. Features internal script debugger which emails database errors to designated admin email.
Categories : PHP, MySQL, Databases
IdealMySQL Database Class - Connect and Query a mysql database including INSERT | DELETE | UPDATE | REPLACE | DROP | SELECT | SHOW | DESCRIBE | EXPLAIN, Catch errors and email them,Check variables to make sure they only contain particular characters.
Categories : PHP, PHP Classes, Databases, MySQL