logs archiveIRC Archive / Freenode / #php / 2015 / October / 9 / 1
larsi
why would you even want to use mysql_* these days
I like my things pretty
mysql_* isn't pretyt
pretty
OmOiYuMe
hmm, this isnt going to be easy to learn right now
sorabji
don't set your bar at easy, that's way too low
OmOiYuMe
the thing is i dont have the time to do it right now
koolranch
Bad_Advice_Cat: question, I have a function that prepares and executes a PDO query, it returns the execution unless it comes up with an error, when I call the function and turn it into a variable. Do I still use a fetchALL() on the function that turns into a variable??
Bad_Advice_Cat
OmOiYuMe, well. Make time then.
OmOiYuMe, so, what is it you do not know about PDO?
sorabji
koolranch: you mean, still call fetchAll if there was an error?
larsi
You should look into: http://php.net/manual/en/class.pdoexception.php
koolranch
no it will stop the fetchALL if there was an error detected.
         

sorabji
as it should
Bad_Advice_Cat
Looking at that tutorial. The concept is simple. - Just like mysql_connect(), you do PDO() and you connect. - Just like mysql_query(), you do PDO->query() or PDO->prepare() - Just like mysql_fetch. you do your ->fetch() in PDO too!
sorabji
i'm confused what your question is then koolranch
Bad_Advice_Cat
OmOiYuMe, :D
koolranch
Let me post an example
Bad_Advice_Cat
koolranch, what is this "it" that you are transforming into a variable?
prepare() ? query() ?
koolranch
https://bpaste.net/show/2f013486eb56
sorabji
koolranch: return is not a function
and, return 109 ?
koolranch
wat
sorabji
just, return 109;
no return()
koolranch
109 ties with the error_code() function
popl
koolranch
it's irrelevant
sorabji
i didn't say it was unheard of
koolranch
the code in question is the fetchALL
popl
koolranch: it's relevant to understanding what the code is doing. :)
koolranch
popl touche
sorabji
what fetchAll ?
koolranch
Line 16
sorabji
that's a fetch
         

popl
^
are you looking at the same code that you pasted?
koolranch
Oh
I meant to put fetchALL
next »