PHP, PDO::FETCH_ASSOC

L00PeR
6 years ago

0

Hey I would like to ask you a couple of things :)

The first one is:
What does this do?:
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
Do you recommend me to use it?

And the second one is:
Whats the difference between:
while ($i=$res->fetch(PDO::FETCH_ASSOC))
And
while ($i=$res->fetch())

1reply
2voices
159views
SIGKILL [r4v463]
6 years ago

1

Here is what you’re looking for :)

[quote=PHP doc]PDO::ATTR_ERRMODE: Error reporting.[/quote]

[quote=PHP doc]PDO::ERRMODE_EXCEPTION: Throw exceptions.[/quote]

[quote=PHP doc]PDO::FETCH_ASSOC: returns an array indexed by column name as returned in your result set[/quote]

And here is the link with the full doc

You must be logged in to reply to this discussion. Login
1 of 2

This site only uses cookies that are essential for the functionality of this website. Cookies are not used for tracking or marketing purposes.

By using our site, you acknowledge that you have read and understand our Privacy Policy, and Terms of Service.

Dismiss