Skip to content

Commit

Permalink
SNOW-1214750 clarify connection example (#373)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-dszmolka authored Mar 7, 2024
1 parent e1ba07c commit 461c36f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -355,15 +355,20 @@ Performing a Simple Query
The following example connects to the Snowflake database and performs a simple query.
Before using this example, set the :code:`$account`, :code:`$user`, and :code:`$password` variables to your account, login name,
and password.
The warehouse, database, schema parameters are optional, but can be specified to determine the context of the connection in which the query will be run.
In this example, we'll use those too.

.. code-block:: php
<$php
$account = "<account_name>";
$user = "<user_name>";
$password = "<password>";
$warehouse = "<warehouse_name>";
$database = "<database_name>";
$schema = "<schema_name>";
$dbh = new PDO("snowflake:account=$account", $user, $password);
$dbh = new PDO("snowflake:account=$account;warehouse=$warehouse;database=$database;schema=$schema", $user, $password);
$dbh->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
echo "Connected\n";
Expand Down

0 comments on commit 461c36f

Please sign in to comment.