The documentation for PDO::quote [0] says that a processed string is
"theoretically safe to pass into an SQL statement". Understandably, prepared
statements should be preferred when possible. But I need to change some stuff
where integrating them is impossible, and some values must be securely
On 28/9/21 6:59 pm, Mathias Zarick wrote:
Hi there,
I am wondering how it would be possible to use authentication using a secure
external password store aka wallet with PDO OCI.
See Oracle external authentication and OCI_CRED_EXT in the underground php
oracle manual.
and
Hi there,
I am wondering how it would be possible to use authentication using a secure
external password store aka wallet with PDO OCI.
See Oracle external authentication and OCI_CRED_EXT in the underground php
oracle manual.
and
Your answer in the part of SAP HANA (J)ODBC driver not supporting named
parameters actually makes sense. However I don't understand why would there
be a difference between PDO and regular odbc (odbc_connect, etc.) commands
since they're obviously using the same driver.
My testing machine is on
On Jan 26, 2016, at 7:10 AM, Alko Kotalko wrote:
> Hi,
>
> I have a working connection from PHP to SAP HANA through PDO and regular
> ODBC commands.
>
> The issue is that through PDO I can not get any prepared statements to
> work. None of the notations (?, $, :) work.
Greetings,
On 01/26/2016 08:18 AM, Karl DeSaulniers wrote:
> On Jan 26, 2016, at 7:10 AM, Alko Kotalko wrote:
>
>> Hi,
>>
>> I have a working connection from PHP to SAP HANA through PDO and regular
>> ODBC commands.
>>
[...snipped...]
>>
>> For example:
>> "SELECT *
On 26/01/16 13:10, Alko Kotalko wrote:
> ODBC commands actually work with the ? and colon ($) notations. But not
> with colon (:). I suppose this is due to the lack of named parameters
> support in ODBC commands (haven't actually confirmed that though). The $
> notation brings me the closest to
I've tried all the notations with PDO as well and none of them work with
SAP HANA. It works with MySQL though. So I presume that there is either a
bug in PDO driver or there is some mismatch between PDO and SAP HANA.
The queries get executed but the returned result (if I fetch one) is an
It shouldn't be like that because I'm preparing a statement, which would
later have had parameters passed to. I'm not trying to concatenate a string.
(Sorry, forgot to reply to all before)
On Tue, Jan 26, 2016 at 8:18 AM, Karl DeSaulniers
wrote:
> On Jan 26, 2016, at 7:10
This (my code) actually works so it's not part of the problem. The problem
is that I can NOT use the colon notation for named parameters, even though
that's my goal :) If I use the colon notation with MySQL (PDO) it works
fine. With ODBC and SAP HANA database it doesn't. I have to use either ? or
Oh ok, thanks for the clarification. Sorry for the noise.
Best,
Karl DeSaulniers
Design Drumm
http://designdrumm.com
On Jan 26, 2016, at 1:07 PM, Alko Kotalko wrote:
> It shouldn't be like that because I'm preparing a statement, which would
> later have had
On 26/01/16 19:06, Alko Kotalko wrote:
> I've tried all the notations with PDO as well and none of them work with
> SAP HANA. It works with MySQL though. So I presume that there is either a
> bug in PDO driver or there is some mismatch between PDO and SAP HANA.
Firebird does not support named
Hi,
I have a working connection from PHP to SAP HANA through PDO and regular
ODBC commands.
The issue is that through PDO I can not get any prepared statements to
work. None of the notations (?, $, :) work. The response from the server
(fetch) gets me empty field values for all selected columns
I'm connecting to a closed-source database called Vertica via unixODBC and
PDO. Everything is working great but I am having trouble getting
PDO::ATTR_TIMEOUT attribute working when I create a connection via:
$this-conn = new PDO($dsn, $user, $password,
History:
I'm trying to help a friend who is hosting his domain with the same
company that I use. I've been using this company for several years and
have used a certain 'connection' script all the time. Part of it looks
like this:
On Fri, Jan 10, 2014 at 10:13 AM, Jim Giner jim.gi...@albanyhandball.comwrote:
History:
I'm trying to help a friend who is hosting his domain with the same
company that I use. I've been using this company for several years and
have used a certain 'connection' script all the time. Part of it
Greetings,
I am new to this list. I have a question about which functions need to be
included in a try block.
Of new PDO, prepare, bindParam, execute, fetch, and query, it
seems that bindParam is the only one that throws an exception. So is this the
only that needs to be put into a
On 4/25/2013 6:49 AM, Niel Archer wrote:
Greetings,
I am new to this list. I have a question about which functions need to be
included in a try block.
Of new PDO, prepare, bindParam, execute, fetch, and query, it seems
that bindParam is the only one that throws an exception. So is this the
Greetings,
I am new to this list. I have a question about which functions need to be
included in a try block.
Of new PDO, prepare, bindParam, execute, fetch, and query, it seems
that bindParam is the only one that throws an exception. So is this the only
that needs to be put into a try
On 1/24/2013 7:07 PM, Matt Pelmear wrote:
On 01/24/2013 04:02 PM, Jim Giner wrote:
I took my 6 line override php.ini file and replicated (with a script)
into all of my possible folders under my web root. NOt exactly an
elegant solution, but with the script, easy to maintain.
Honestly, you
On 1/25/2013 10:56 AM, Jim Giner wrote:
On 1/24/2013 7:07 PM, Matt Pelmear wrote:
On 01/24/2013 04:02 PM, Jim Giner wrote:
I took my 6 line override php.ini file and replicated (with a script)
into all of my possible folders under my web root. NOt exactly an
elegant solution, but with the
ok - new to using pdo functions, but I thought I had a handle on it.
I'm writing out to my page an input tag with the following value in it:
49'ers
I can confirm it by using my browser's view source to see that is
exactly how it exists in the page.
When I hit a submit button and my script
http://stackoverflow.com/questions/5801951/does-php-auto-escapes-quotes-in-string-which-is-passed-by-get-or-post
Every pro has this feature (magic_quotes_gpc) turned off. If you
understand SQL Injection vulnerabilities, and properly bind things into
your queries, I would recommend disabling
On 1/24/2013 12:05 PM, Matt Pelmear wrote:
http://stackoverflow.com/questions/5801951/does-php-auto-escapes-quotes-in-string-which-is-passed-by-get-or-post
Every pro has this feature (magic_quotes_gpc) turned off. If you
understand SQL Injection vulnerabilities, and properly bind things into
On 01/24/2013 09:23 AM, Jim Giner wrote:
On 1/24/2013 12:05 PM, Matt Pelmear wrote:
http://stackoverflow.com/questions/5801951/does-php-auto-escapes-quotes-in-string-which-is-passed-by-get-or-post
Every pro has this feature (magic_quotes_gpc) turned off. If you
understand SQL Injection
On 24 January 2013 17:48, Matt Pelmear mjpelm...@gmail.com wrote:
On 01/24/2013 09:23 AM, Jim Giner wrote:
On 1/24/2013 12:05 PM, Matt Pelmear wrote:
http://stackoverflow.com/questions/5801951/does-php-auto-escapes-quotes-in-string-which-is-passed-by-get-or-post
Every pro has this feature
On 1/24/2013 1:41 PM, Richard Quadling wrote:
On 24 January 2013 17:48, Matt Pelmear mjpelm...@gmail.com wrote:
On 01/24/2013 09:23 AM, Jim Giner wrote:
On 1/24/2013 12:05 PM, Matt Pelmear wrote:
On 01/24/2013 12:00 PM, Jim Giner wrote:
On 1/24/2013 1:41 PM, Richard Quadling wrote:
On 24 January 2013 17:48, Matt Pelmear mjpelm...@gmail.com wrote:
On 01/24/2013 09:23 AM, Jim Giner wrote:
On 1/24/2013 12:05 PM, Matt Pelmear wrote:
If you are using another web server or running PHP as FastCGI you may
need to consider other options (changing the setting globally or doing a
require_once() of your config changes?, or see the FastCGI example here:
http://www.askapache.com/php/php-htaccess-tips-tricks.html)
-Matt
It sounds
On Jan 24, 2013, at 2:15 PM, Matt Pelmear wrote:
On 01/24/2013 12:00 PM, Jim Giner wrote:
On 1/24/2013 1:41 PM, Richard Quadling wrote:
On 24 January 2013 17:48, Matt Pelmear mjpelm...@gmail.com wrote:
On 01/24/2013 09:23 AM, Jim Giner wrote:
On 1/24/2013 12:05 PM, Matt Pelmear wrote:
On 01/24/2013 01:37 PM, Karl DeSaulniers wrote:
On Jan 24, 2013, at 2:15 PM, Matt Pelmear wrote:
On 01/24/2013 12:00 PM, Jim Giner wrote:
On 1/24/2013 1:41 PM, Richard Quadling wrote:
On 24 January 2013 17:48, Matt Pelmear mjpelm...@gmail.com wrote:
On 01/24/2013 09:23 AM, Jim Giner wrote:
On 01/24/2013 01:34 PM, Jim Giner wrote:
If you are using another web server or running PHP as FastCGI you may
need to consider other options (changing the setting globally or doing a
require_once() of your config changes?, or see the FastCGI example here:
On 1/24/2013 4:37 PM, Karl DeSaulniers wrote:
On Jan 24, 2013, at 2:15 PM, Matt Pelmear wrote:
On 01/24/2013 12:00 PM, Jim Giner wrote:
On 1/24/2013 1:41 PM, Richard Quadling wrote:
On 24 January 2013 17:48, Matt Pelmear mjpelm...@gmail.com wrote:
On 01/24/2013 09:23 AM, Jim Giner wrote:
On 1/24/2013 6:03 PM, Matt Pelmear wrote:
On 01/24/2013 01:37 PM, Karl DeSaulniers wrote:
On Jan 24, 2013, at 2:15 PM, Matt Pelmear wrote:
On 01/24/2013 12:00 PM, Jim Giner wrote:
On 1/24/2013 1:41 PM, Richard Quadling wrote:
On 24 January 2013 17:48, Matt Pelmear mjpelm...@gmail.com
On 1/24/2013 6:09 PM, Matt Pelmear wrote:
On 01/24/2013 01:34 PM, Jim Giner wrote:
If you are using another web server or running PHP as FastCGI you may
need to consider other options (changing the setting globally or doing a
require_once() of your config changes?, or see the FastCGI example
On 01/24/2013 04:02 PM, Jim Giner wrote:
I took my 6 line override php.ini file and replicated (with a script)
into all of my possible folders under my web root. NOt exactly an
elegant solution, but with the script, easy to maintain.
Honestly, you would be better off just putting those 6
Doing some conversion - looking for a solution.
Currently I do something like this:
while (list($var1,$var2) = mysql_fetch_array($qrslts))
{
handle the vars
}
Is there something in the PDO functions that emulates this same ability?
Some of my uses of the sql syntax have many more vars
On 15. 1. 2013 18:25, Jim Giner wrote:
Doing some conversion - looking for a solution.
Currently I do something like this:
while (list($var1,$var2) = mysql_fetch_array($qrslts))
{
handle the vars
}
Is there something in the PDO functions that emulates this same
ability? Some of my uses
Brandon: RAM is cheap, but not always expendable depending on what
you're doing.
Using count() on results from PDOStatement::fetchAll() is fine on small
result sets.
Keep in mind that this will certainly blow up on very large result sets,
especially depending on your memory_limit for php.
Hi Jim
I've had some success with querying using pdo and prepared statements as
well. One thing that I'm curious about is
How does one handle the need to get the number of rows returned by a
Select? The documentation is very clear that PDO doesn't return that
value for a Select statement
How are you using the number? Probably the easiest way is to utilize
PDOStatement::FetchAll() and then do a count() on that result set.
- Mike
Sent from my iPhone
On Sep 9, 2012, at 11:42 AM, Stefan Wixfort stefan.wixf...@gmx.de wrote:
Hi Jim
I've had some success with querying using
That's how I'd do it. Extend the PDO interface on your abstract class
to include a num_rows() method that utilizes that higher level
count($this-result). It might be a little more overhead... but RAM is
cheap... and there's always forking/extending the library in C/C++...
-Brandon
On
Michael Stowe wrote:
How are you using the number? Probably the easiest way is to utilize
PDOStatement::FetchAll() and then do a count() on that result set.
There are two things to bear in mind here. Often you are only displaying a
subset of records - ten per page perhaps - and so a count
I finally delved into learning how I was going to replace my MYSQL calls
with a different interface. Had to go with PDO since my hoster doesn't
support MYSQLI for my plan.
I've had some success with querying using pdo and prepared statements as
well. One thing that I'm curious about is
Hello,
I'm trying to detect data truncation on insert to MySQL using PDO.
As far as I can tell, this gets reported at least in some cases (ex:
http://drupal.org/node/1528628), but I have been unable to see this myself.
The test table I'm using has a column that is VARCHAR(5):
mysql describe
Hi Vinay,
No, using native mysql_* statement isn't always faster. Advantages are
obvious, as mentioned in the article you shared (object mapping, security,
performance), there's always things like caching and other stuff you don't
want to reinvent the wheel for and on big projects tend to be
Hi Trevor,
Thank You for your suggestion, yeah i think caching is something i
definitely want to look at and something thats important, and there is a
big project coming up, its pretty much the biggest i've taken up so far,
theres also a mobile app for android which needs to be done, so caching
Hey Guys,
I came across this article.
http://net.tutsplus.com/tutorials/php/pdo-vs-mysqli-which-should-you-use/
Though I've been working with PHP for over 2 yrs, i never bothered to use
the techniques mentioned in the articles like this.
What i do for DB connections and queries..is just simple
Hi List,
It seems that I'm a little confused (and thus frustrated) with PDO in
general, and especially when it comes to PECL php_sqlite3.
I understand that PDO is a data-access abstraction layer, and as one, is
really good. However, the way I see it, is that PDO should just be an added
extra,
Hi List,
It seems that I'm a little confused (and thus frustrated) with PDO in
general, and especially when it comes to PECL php_sqlite3.
I understand that PDO is a data-access abstraction layer, and as one, is
really good. However, the way I see it, is that PDO should just be an added
On 24 March 2010 18:04, Aaron Paetznick aar...@critd.com wrote:
Thanks for the advise. I wanted a more automatic method of prefixing column
names, but I ended up just aliasing them all.
I know I could always just issue multiple SELECTs, but I wish MySQL would
support this sort of
Many of my MySQL tables have columns with the same name. I want to have
PDO include table names in named result sets. For example:
$sth = $dbh-prepare(SELECT * FROM table0, table1);
$result = $sth-fetchAll(PDO::FETCH_ASSOC);
I want $result to be organized like:
echo
Many of my MySQL tables have columns with the same name. I want to have
PDO include table names in named result sets. For example:
$sth = $dbh-prepare(SELECT * FROM table0, table1);
$result = $sth-fetchAll(PDO::FETCH_ASSOC);
I want $result to be organized like:
echo
On 24 March 2010 16:05, Aaron Paetznick aar...@critd.com wrote:
Many of my MySQL tables have columns with the same name. I want to have PDO
include table names in named result sets. For example:
$sth = $dbh-prepare(SELECT * FROM table0, table1);
$result = $sth-fetchAll(PDO::FETCH_ASSOC);
Thanks for the advise. I wanted a more automatic method of prefixing
column names, but I ended up just aliasing them all.
I know I could always just issue multiple SELECTs, but I wish MySQL
would support this sort of functionality natively. I'd really like to
reference my results as
Samuel ROZE wrote:
Hi,
Thanks for your reply.
In fact, my request returns a result which i get with the fetch method.
But, it must returns other informations, which are not in the result...
This informations are neturned before the result in console...
So, i don't know how I can get that.
Thanks a lot ! I'm now understanding why PDO exists.. It is not for
replace the actual PostgreSQL/MySQL/SQLite/Firebird/... PHP drivers but
for help to developp with many DB with one code.
Well... I can developp an extension to PDO PostgreSQL driver, is that
correct ? It may help many users like
Hi !
I'm reading the source of PDO PostgreSQL driver and i see that there's
an empty function, _pdo_pgsql_notice, which is very interesting ! I
think that it is used when PostgreSQL throw Notices.
But, nothing is done...
I want to know if somebody know why the content of the function is
To use PostgreSQL's Notices with PDO, i'm modifying the source for
trying to store into errmsg (which I can get with PDO::errorInfo) the
notice.
The _pdo_pgsql_notice function is called everytime that there's an
notice. The notice message is in the message var. This what i had
tried:
Samuel ROZE wrote:
To use PostgreSQL's Notices with PDO, i'm modifying the source for
trying to store into errmsg (which I can get with PDO::errorInfo) the
notice.
The _pdo_pgsql_notice function is called everytime that there's an
notice. The notice message is in the message var. This what i
Hi !
I'm new on this mailling list, so i don't realy know if you know the
response and if it is realy here that I have to ask my question :-)
I'm working with PostgreSQL (8.3 form sources) and PDO (PHP 5.2.10 from
sources). In a Postgres function, I have a RAISE NOTICE command. My
function works
Hi,
Query returns an iterable object (thanks to the comments in the php
site) and that's why when you do a dump you just see the String,
If you just want to get one row from the resultset you can get it like
this:
$stat = $sql-query('SELECT * FROM public.test_info()')-fetch();
More
Hi,
Thanks for your reply.
In fact, my request returns a result which i get with the fetch method.
But, it must returns other informations, which are not in the result...
This informations are neturned before the result in console...
So, i don't know how I can get that.
Samuel.
Le lundi 05
Hey Guys,
I'm working with a SQL Server stored procedure that returns error codes;
here is a very simple snippet of the SP.
DECLARE @ret int
BEGIN
SET @ret = 1
RETURN @ret
END
I can't figure out how to access the return value in PDO; I'd prefer not to
use an OUT parameter, as
Hi there,
I'm having some serious problems with the PHP Data Object functions. I'm
trying to loop through a sizeable result set (~60k rows, ~1gig) using a
buffered query to avoid fetching the whole set.
No matter what I do, the script just hangs on the PDO::query() - it
seems the query is
Matthew Peltzer wrote:
ok... this makes more sense now. I know in the past I tried to do
something similar with table names in the WHERE clause, and that
didn't work in the same manner.
Is there a better way to do what I'm trying to do? that is, sorting
within the SQL statement based on a
Chris wrote:
Matthew Peltzer wrote:
ok... this makes more sense now. I know in the past I tried to do
something similar with table names in the WHERE clause, and that
didn't work in the same manner.
Is there a better way to do what I'm trying to do? that is, sorting
within the SQL statement
ok... this makes more sense now. I know in the past I tried to do
something similar with table names in the WHERE clause, and that
didn't work in the same manner.
Is there a better way to do what I'm trying to do? that is, sorting
within the SQL statement based on a supplied column name without
Your workaround is probably what I would do myself.
Note: mysql_real_escape_string() is technically expecting a string
value, although there is no harm using it, and it's not a bad idea to
avoid possible SQL malicious codes. Alternately, you can also write a
simple function using regular
Are pdo bound parameters within an ORDER BY clause broken in php 5.2.5?
I find that in php 5.2.6 this works as expected:
?php
$sql = 'SELECT * FROM `table` ORDER BY :sort';
$stmt = $pdo-prepare($sql);
$stmt-bindValue(':sort', $sort, PDO::PARAM_STR);
$stmt-execute();
O/H TK ??:
At 03:21 AM 7/9/2008, Thodoris wrote:
At 04:16 PM 7/8/2008, Philip Thompson wrote:
On Jul 8, 2008, at 11:55 AM, TK wrote:
I'd like to use a PDO prepared statement to perform a MySQL query
that uses the IN function.
I.e.:
$stmt = $pdo-prepare('
select *
At 05:53 PM 7/8/2008, TK wrote:
I'd like to use a PDO prepared statement to perform a MySQL query
that uses the IN function.
I may have found my answer (in the PHP manual, under PDO-prepare(). Go
figure!):
You cannot bind multiple values to a single named parameter in, for example,
the IN()
At 03:23 AM 7/10/2008, Thodoris wrote:
Why don't you work this around. Since you may do anything with strings in php
using the (.) operator try this:
?php
$a = array('string1','string2');
$str = implode(',',$a);
$str = '.$str.';
print $str;
?
Thanks, but this is missing the entire point of my
As you already know, you will dynamically create the $contents.
See if you can dynamically create the entire prepare statement which
includes the $contents, as well as dynamically create the bindValue
statement; then see if you can eval those dynamically created statements.
$commandPrepare =
At 04:16 PM 7/8/2008, Philip Thompson wrote:
On Jul 8, 2008, at 11:55 AM, TK wrote:
I'd like to use a PDO prepared statement to perform a MySQL query
that uses the IN function.
I.e.:
$stmt = $pdo-prepare('
select *
from mytable
where myfield IN (:contents)
);
At 03:21 AM 7/9/2008, Thodoris wrote:
At 04:16 PM 7/8/2008, Philip Thompson wrote:
On Jul 8, 2008, at 11:55 AM, TK wrote:
I'd like to use a PDO prepared statement to perform a MySQL query
that uses the IN function.
I.e.:
$stmt = $pdo-prepare('
select *
from mytable
where myfield IN
I'd like to use a PDO prepared statement to perform a MySQL query that uses the
IN function.
I.e.:
$stmt = $pdo-prepare('
select *
from mytable
where myfield IN (:contents)
);
$stmt-bindValue(':contents', $contents);
$stmt-execute();
Here's the problem:
If $contents is set to a single
On Jul 8, 2008, at 11:55 AM, TK wrote:
I'd like to use a PDO prepared statement to perform a MySQL query
that uses the IN function.
I.e.:
$stmt = $pdo-prepare('
select *
from mytable
where myfield IN (:contents)
);
$stmt-bindValue(':contents', $contents);
$stmt-execute();
Here's the
At 04:16 PM 7/8/2008, Philip Thompson wrote:
On Jul 8, 2008, at 11:55 AM, TK wrote:
I'd like to use a PDO prepared statement to perform a MySQL query
that uses the IN function.
I.e.:
$stmt = $pdo-prepare('
select *
from mytable
where myfield IN (:contents)
);
$stmt-bindValue(':contents',
Hey,
I'm using a PDO-MySQL in a class of my Accounting-Framework. The problem: if
I call my function query(), see below, multiple times, I get the error:
Array ( [0] = HY000 [1] = 2014 [2] = Cannot execute queries while other
unbuffered queries are active. Consider using
It would be helpful if the time zone of a session could be specified at
the time of the connection. This would avoid the overhead of a separate
database query and round-trip to the database server when a single,
non-default time zone is needed for the duration of the connection.
Naturally there
Paul Rogers wrote:
It would be helpful if the time zone of a session could be specified at
the time of the connection. This would avoid the overhead of a separate
database query and round-trip to the database server when a single,
non-default time zone is needed for the duration of the
Folks,
I was looking at rewriting some old DB classes using PDO with the Oracle
driver, but I'm a bit confused about the current state of things. Some
docs said the PDO Oracle driver was experimental and subject to change.
I also had a hard time trying to get the driver to compile against
I tried using pdo (www.php.net/pdo) as it would be nice for my projects
to be portable to another database systems, but quickly ran into problems.
The lesser important: One time, there was a simple typo in one of my
queries and I got an error that php is not able to save session
variables
Hello there,
I tried using pdo (www.php.net/pdo) as it would be nice for my projects to
be portable to another database systems, but quickly ran into problems.
The lesser important: One time, there was a simple typo in one of my queries
and I got an error that php is not able to save session
Hello,
I'm leading the PhpMyObject (PMO) Project:
official website:
http://pmo.developpez.com
It's an object abstraction layer that permits to convert data from PDO
to unitary PHP object (not row).
Example:
| require_once
I wish to know who i can contact from PDO Team to submit evolutions ?
No particular person. I think Wez was in charge when it was being built
but it's all integrated into the core php now - so join the -internals
list and make a proposal/suggestion.
--
Postgresql php tutorials
I'm using PHP 5.1. The documentation for PDO doesn't list MS Sql server as one
of the drivers that support PDO but there is a php_pdo_mssql.dll which seems to
work so I'm using that.
I need to get the id of a new record just inserted. I can't use lastInsertId()
as I get a message saying it's
Bruce Cowin wrote:
I'm using PHP 5.1. The documentation for PDO doesn't list MS Sql server as one
of the drivers that support PDO but there is a php_pdo_mssql.dll which seems to
work so I'm using that.
I need to get the id of a new record just inserted. I can't use lastInsertId()
as I get
Thanks for replying. According to the PDO doco: If the database driver
supports it, you may also bind parameters for output as well as input. So
maybe this driver doesn't support it? I don't know. I'll try and get the
stored proc to return the value, but not sure how I'll capture that yet.
Bruce Cowin wrote:
Thanks for replying. According to the PDO doco: If the database driver supports it, you may
also bind parameters for output as well as input. So maybe this driver doesn't support it?
I don't know. I'll try and get the stored proc to return the value, but not sure how
Hi,
I'm trying to get some data form a MySQL db using PDO and prepared
statement, but I noticed that sometimes it fetches an empty result set,
but sometimes does what it's supposed to do - returns the whole result set.
The environment is WinXP SP2 Home, Apache 2.2.4, PHP 5.2.1 and MySQL
Is it my imagination, or does setAttribute return FALSE on success and TRUE
on failure? I've tested it with getAttribute, and it definitely seems to
work the reverse of what the documentation states.
I'm using MySQL, and I am setting the error handling.
--
PHP Database Mailing List
I hope by now you figured this out, but you have to use $dbh-setAttribute()
to enable exception handling for anything but the initial object creation.
Worse yet, as of 2007/04/20 the return values of setAttribute are reversed.
It returns TRUE on failure and FALSE on success.
Rodney Topor
Hello,
I've some problems with calling stored procedures.
When I try to execute the demonstration example on php.net I get no result, but
it works with normal SQL-commandqueries
software: MAMP-package: php 5.1.6, mysql 5.0.19, apache 2.0.59
my stored procedure is for this example returns a
i'm running php PHP Version 5.1.6-pl6-gentoo and have run into a bit
of a snag with pdo prepared statements and parameters. we use
parameters in all our queries, but just recently tried to add limits to
some of the queries so we can do paging. when attempting to add a
parameter to the limit
Rudi Worm wrote:
Hi
Using PDO to prepare a query, bind som values to it (using ? Placeholders)
and then executing it - how do i get the actual query afterwards? With the
correct inserted values.
Use your system database logs. PDO doesn't give you the opportunity to
grab them.
--
Hi
Using PDO to prepare a query, bind som values to it (using ? Placeholders)
and then executing it - how do i get the actual query afterwards? With the
correct inserted values.
It is needed logging purposes.
I haven't been able to find any method or property that gives me this
information.
]
Sent: Wednesday, June 21, 2006 5:39 PM
To: Vandegrift, Ken
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] PDO and Exceptions
Vandegrift, Ken wrote:
Good Afternoon,
I have an instance of a PDO object set to throw a PDOException on
errors. However, it does not appear to do this when
Good Afternoon,
I have an instance of a PDO object set to throw a PDOException on
errors. However, it does not appear to do this when a primary key
violation error occurs on an insert sql statement. An exception should
be thrown in this case correct?
The insert statements are part of a
1 - 100 of 128 matches
Mail list logo