[Development Guides Home](/guides) >> [Guide to the LiveAPI System](/guides/guide-to-the-liveapi-system) >> [LiveAPI Methods](/guides/guide-to-the-liveapi-system/guide-to-the-liveapi-system-liveapi-methods)

# Guide to the LiveAPI System - The cpanelif() Method

The `cpanelif()` method is a wrapper for the `cpanelif` tag, which evaluates a cPanel variable or logic operator.

## Example

### LiveAPI PHP Class


```php
// Check whether a mysql error message exists.
$cpanel->cpanelif ("$CPERROR{'mysql'}");
```

### LiveAPI Perl Module


```perl
# Check whether a mysql error message exists.
$cpliveapi->cpanelif("$CPERROR{'mysql'}");
```

## Parameters

| Parameter | Type | Description | Possible values | Example |
|  --- | --- | --- | --- | --- |
| `conditional` | *string* | A cPanel variable or logic operator.  For a full list of cPanel variables and logic operators, read our [Guide to cPanel Variables](/guides/guide-to-cpanel-variables). | A valid cPanel variable.  A logic operator. | `$CPERROR{'mysql'}` |


## Returns

This method returns a Boolean value:

* `1` — The cPanel variable or code evaluates to true.
* `0` — The cPanel variable or code evaluates to false.