PHPackages                             ticketsource/sql-anywhere-client - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. ticketsource/sql-anywhere-client

ActiveLibrary

ticketsource/sql-anywhere-client
================================

SAP SQL Anywhere PHP client library

v1.0(7y ago)025MITPHPPHP &gt;=7.0

Since Nov 13Pushed 7y ago2 watchersCompare

[ Source](https://github.com/ticketsource/sql-anywhere-client)[ Packagist](https://packagist.org/packages/ticketsource/sql-anywhere-client)[ RSS](/packages/ticketsource-sql-anywhere-client/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

SQLAnywhereClient
=================

[](#sqlanywhereclient)

Classe para conexão com banco de dados Sybase com PHP baseada na biblioteca sqlanywhere. Class for connection with database Sybase with PHP, created for PHP library SqlAnywhere.

The development was based on PDO Native Class.

TODO:

- More tests.

Installation
------------

[](#installation)

=================

1- First install sqlanywhere module for PHP [Click Here!](http://scn.sap.com/docs/DOC-40537).

2- Use composer to install this package adding the lines bellow in the require section `require`: // ... "require": { "cagartner/SQLAnywhereClient": "dev-master" }, // ...

How to use
==========

[](#how-to-use)

Bellow have some examples of how to use this class.

### Connection `SQLAnywhereClient::__construct`:

[](#connection-sqlanywhereclient__construct)

```

```

Você pode definir duas opções iniciais junto com a conexão, que são as seguintes: `auto_commit` e `is_persistent`. You can define two initials configuration params with the connection: `auto_commit` and `is_persistent`.

- `auto_commit` Enable auto commit, default is `true`;
- `is_persistent` Define persistent mode, default is `false`;

```

```

### Executing SQL commands `SQLAnywhereClient::exec()`:

[](#executing-sql-commands-sqlanywhereclientexec)

```

```

### Executing SQL commands with retrieve of data `SQLAnywhereClient::query()` :

[](#executing-sql-commands-with-retrieve-of-data-sqlanywhereclientquery-)

This method return an array with the data

```

```

### Retrieve just one line `SQLAnywhereQuery::fetch`

[](#retrieve-just-one-line-sqlanywherequeryfetch)

Return first row

```

```

### Data format returns

[](#data-format-returns)

You can choose how is the format that your data is retrieve `SQLAnywhereClient`

```

```

Example:

```

```

### Return all rows `SQLAnywhereQuery::fetchAll`

[](#return-all-rows-sqlanywherequeryfetchall)

Return all selected rows

```

```

In this method you also can choose the format of return too:

```

```

### Row count `SQLAnywhereQuery::rowCount`

[](#row-count-sqlanywherequeryrowcount)

Return the count of rows

```

```

Or with `count` alias:

```

```

### Field count `SQLAnywhereQuery::fieldCount`

[](#field-count-sqlanywherequeryfieldcount)

Return the total of fields

```

```

### Last ID `SQLAnywhereClient::lastInsertId()`

[](#last-id-sqlanywhereclientlastinsertid)

Return the last inserted ID

```
