Re: Calling a PostgreSQL function via DBI
- From: christian.stalp@xxxxxx (Christian Stalp)
- Date: Thu, 23 Feb 2006 21:52:57 +0100 (MET)
Christian,
As an example, I'd do the following:
$arg1 = "$cookieValue" . "::numeric";
...
$result = $dbh->prepare ( "insert into kunden ( kid, nachname, ..., )
values ( ?, ?, ... )" );
$sqls->bind_param(1, $user_nummer);
$sqls->bind_param(2, $nachname);
...
$sqls->execute();
$sqls->finish();
That will take care of your inserting issues. the "bind_param()" function
takes care of the variables and puts them in a 'proper' form.
As for your select statement with the $arg1, ..., $argN, the bind_param()
function will work on those arguments too, I'd just suggest to use the
process of double quoting your string concatenation assignments upfront:
$arg1 = "$someVariable" . "::someText";
Hope this helps.
Hello Lois,
$sqls->bind_param(1, $user_nummer);
$sqls->bind_param(2, $nachname);
What kind of object is this, $sqls? Or is it just another DBI-handler?
Gruss Christian
--
DSL-Aktion wegen großer Nachfrage bis 28.2.2006 verlängert:
GMX DSL-Flatrate 1 Jahr kostenlos* http://www.gmx.net/de/go/dsl
.
- References:
- Re: Calling a PostgreSQL function via DBI
- From: Louis Gonzales
- Re: Calling a PostgreSQL function via DBI
- Prev by Date: Re: Calling a PostgreSQL function via DBI
- Next by Date: Re: Calling a PostgreSQL function via DBI
- Previous by thread: Re: Calling a PostgreSQL function via DBI
- Next by thread: Re: Calling a PostgreSQL function via DBI
- Index(es):
Relevant Pages
|