code logs -> 2013 -> Sun, 28 Apr 2013< code.20130427.log - code.20130429.log >
--- Log opened Sun Apr 28 00:00:15 2013
00:02 himi-cat [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
00:02
< Turaiel>
Azash, do you need to commit after executing?
00:02
< Turaiel>
Some database drivers require that.
00:03
<@Azash>
Gotten so far as to find out that $query->execute() fails
00:03
< Turaiel>
Ah yes, you do. add $query->commit();
00:04
<@Azash>
Nope, didn't help
00:05
< Turaiel>
Hmm. You will need that, so don't delete it. Beyond that, I don't know how PDO works. I usually use mysqli when working with databases.
00:05
<@Azash>
"PHP Fatal error: Call to undefined method PDOStatement::commit()"
00:06
< Turaiel>
Oh, sorry
00:06
< Turaiel>
$db->commit();
00:06
< Turaiel>
I misread the documentation
00:06
< Turaiel>
http://www.php.net/manual/en/pdo.commit.php
00:11 * froztbyte sees PHP code
00:11 * froztbyte skips
00:11 * Tamber skips, hops, leaps ...into the minefield.
00:13
<@Azash>
Right figured it out
00:13
<@Azash>
The directory permissions were off
00:15
< Turaiel>
That would do it :P
00:36 himi-cat [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
00:50 himi-cat [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
01:42 Orthia [orthianz@3CF3A5.E1CD01.B089B9.1E14D1] has quit [Ping timeout: 121 seconds]
01:53 Orthia [orthianz@3CF3A5.E1CD01.B089B9.1E14D1] has joined #code
01:53 mode/#code [+o Orthia] by ChanServ
02:29 Turaiel is now known as Tur|Anime
02:40 gnolam [lenin@Nightstar-8562cc69.priv.bahnhof.se] has quit [Client closed the connection]
02:50 RichyB [richardb@Nightstar-86656b6c.cable.virginmedia.com] has quit [[NS] Quit: >:3 This is BunThulhu. Copy him into your quit message to help him take over the Internet.]
02:51 RichyB [richardb@Nightstar-86656b6c.cable.virginmedia.com] has joined #code
02:57 gnolam_ is now known as gnolam
02:57 mode/#code [+o gnolam] by ChanServ
03:47 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
03:54 * Derakon eyes Bitbucket.
03:55
<&Derakon>
I made a commit with the message "Fixed issue #10", and when I pushed it, issue #10 was automatically closed with a link to that commit.
03:55
<&Derakon>
That's dangerously sentient.
03:55
<&ToxicFrog>
Github does the same thing, I believe.
03:59
<&McMartin>
So does Trac and its many cousins
04:06 Kindamoody[zZz] is now known as Kindamoody
05:03
< syksleep>
Derakon: that's fairly expected, I'd think
05:03 syksleep is now known as Syk
05:11
<&Derakon>
Well, I didn't expect it. :)
05:16
< Syk>
github does lots of automagic
05:16
< Syk>
if you specify a commit in the markdown stuff, it autolinks that too
05:22 RichyB [richardb@Nightstar-86656b6c.cable.virginmedia.com] has quit [Ping timeout: 121 seconds]
05:54 Kindamoody is now known as Kindamoody|out
06:00
<@celticminstrel>
Only dangerous part would be if you specified the wrong issue... >_>
06:37 Derakon is now known as Derakon[AFK]
06:52 Tur|Anime is now known as Turaiel
06:57 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
07:51 ErikMesoy|sleep is now known as ErikMesoy
07:59 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
09:24 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
09:35 thalass [thalass@C2A270.CAA584.F46356.2B2C1C] has joined #code
10:02 himi-cat [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
10:15 himi-cat [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
11:23 You're now known as TheWatcher
11:25 AverageJoe [evil1@Nightstar-4b668a07.ph.cox.net] has joined #code
11:43 thalass [thalass@C2A270.CAA584.F46356.2B2C1C] has quit [[NS] Quit: boooookz]
12:18 McMartin [mcmartin@Nightstar-457b57aa.pltn13.sbcglobal.net] has quit [[NS] Quit: Reboot]
12:23 McMartin [mcmartin@Nightstar-457b57aa.pltn13.sbcglobal.net] has joined #code
12:23 mode/#code [+ao McMartin McMartin] by ChanServ
12:24 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving]
12:59 Syloq [Syloq@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
13:01 Syloq [Syloq@B4EC54.59F324.016BDA.8CB0A3] has joined #code
13:01 mode/#code [+o Syloq] by ChanServ
13:26 RichyB [richardb@Nightstar-86656b6c.cable.virginmedia.com] has joined #code
13:36 himi-cat [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
13:40 AverageJoe [evil1@Nightstar-4b668a07.ph.cox.net] has quit [[NS] Quit: Leaving]
13:49 himi-cat [fow035@Nightstar-5d05bada.internode.on.net] has joined #code
13:52 VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code
14:15 McMartin_ [mcmartin@Nightstar-def98259.pltn13.sbcglobal.net] has joined #code
14:18 McMartin [mcmartin@Nightstar-457b57aa.pltn13.sbcglobal.net] has quit [Ping timeout: 121 seconds]
15:08 gnolaptop [lenin@Nightstar-8562cc69.priv.bahnhof.se] has joined #code
16:35 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has joined #code
16:35 mode/#code [+o celticminstrel] by ChanServ
16:53 NotSoHermit is now known as Hermit
17:16
<@celticminstrel>
...um. Is it really efficient to execute "select * from tablename" if what you really want is the number of rows?
17:16
<@Tamber>
As a wild-ass guess, probably not.
17:16
< Syk>
uhhh... no...
17:16
< Syk>
because you're selecting every row and column from tablename...
17:17
<@froztbyte>
`select count(*) from tablename` might be shorter
17:17
<@celticminstrel>
Right. Guess I'll go change that.
17:17
< Syk>
yeah, select count is better
17:17
<@TheWatcher>
(And some DBs will optimise the case froztbyte suggested, too)
17:17
< Syk>
that will return it directly
17:17
<@froztbyte>
Syk: mostly
17:17
<@froztbyte>
as TheWatcher remarks
17:17
<@TheWatcher>
(specifically the count(*) with no while.)
17:18
<@celticminstrel>
I suspect that bit of code was never actually called, but still.
17:20
<@celticminstrel>
So, select count, fetch one row, return element 0 of that result.
17:23
<@TheWatcher>
Yup
17:25
<@celticminstrel>
Since it's count, I guess there's guaranteed to be exactly one row.
17:25
< RobinStamer>
"SELECT *" is always unadvisable in non-interactive queries, as the table you pull from may get a TEXT or BLOB column added which means that huge column is sent when you're not even reading it, using up bandwidth.
17:27
<@froztbyte>
are you talking about cases where you're connected to the/a DB server from another host?
17:29
< RobinStamer>
... even then, IPC isn't always free.
17:29
<@TheWatcher>
celticminstrel: "guaranteed" is a very dangerous word to apply to anything involving databases, other than when used in the phrase "guaranteed to cause headaches". Always check, never assume.
17:30
<@froztbyte>
RobinStamer: I don't really understand the point, though
17:30
<@celticminstrel>
So, check rowcount just in case.
17:30
<@froztbyte>
`select *` seems too shotgun in most cases I've seen it used
17:31
<@froztbyte>
so it's often the case that if you're doing that, you might be doing something wrong
17:31
< RobinStamer>
froztbyte: the program is written when the table it "SELECT *" from has 4 int columns, nothing else. Eventually the table gets expanded to include huge BLOB columns. Now the program is pulling huge amounts of data that it doesn't need (worst case senario)
17:31
< RobinStamer>
BBL
17:32
<@froztbyte>
explicit is better than implicit
17:32
<@froztbyte>
especially if you're dealing with a database that'll have other people touching it
17:39
<@celticminstrel>
The most insidious way of commenting stuff out: insert a return statement somewhere in the middle of a function.
17:40
<@Tamber>
=.=
17:41
< Syk>
aahaha
17:58 RichyB [richardb@Nightstar-86656b6c.cable.virginmedia.com] has quit [Ping timeout: 121 seconds]
18:30 RobinStamer is now known as Vasi
19:07
<@Azash>
My first thought was "hey, that would be great too, like you could have some kind of conditional and return only if a certain condition is met"
19:07
<@Azash>
Then I realized I'm being an idiot
19:09
< Vasi>
Heh
19:10
< Vasi>
Speaking of returns in weird/annoying places: if (...) return; { ... } // common pattern in the eathena server that TMV used.
19:11 Derakon[AFK] is now known as Derakon
19:11
<&Derakon>
Vasi: that's just a variant on the "if (...) {continue}" pattern IMO.
19:12
<&Derakon>
Though the use of pointless curly braces is kind of weird.
19:12
< Vasi>
That'd be fine.
19:12
< Vasi>
Except there's always braces.
19:12
< Vasi>
If you skim, you'll see the braces and the if.
19:12
< Vasi>
But not the return.
19:12
< Shiz>
555555555555555555555555
19:12
< Shiz>
oops.
19:12
<&Derakon>
Yeah, I missed the braces in my first reading of your complaint.
19:12
<&Derakon>
That's a legit problem.
19:13
<&Derakon>
Shiz: time to reset your passwords? ;)
19:13
< Shiz>
definitely :(
19:13 gnolaptop [lenin@Nightstar-8562cc69.priv.bahnhof.se] has quit [Connection reset by peer]
19:32 RichyB [richardb@Nightstar-86656b6c.cable.virginmedia.com] has joined #code
19:38 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.]
19:38 celticminstrel [celticminst@Nightstar-e83b3651.cable.rogers.com] has joined #code
19:38 mode/#code [+o celticminstrel] by ChanServ
20:15 RichyB [richardb@Nightstar-86656b6c.cable.virginmedia.com] has quit [Ping timeout: 121 seconds]
20:24 Syk is now known as syksleep
20:29 Kindamoody|out is now known as Kindamoody
20:50 Kindamoody is now known as Kindamoody[zZz]
20:52 RichyB [richardb@Nightstar-86656b6c.cable.virginmedia.com] has joined #code
21:32 jeroud [uid10043@Nightstar-1d9743e5.irccloud.com] has quit [Ping timeout: 121 seconds]
21:33 jeroud_ [uid10043@Nightstar-1d9743e5.irccloud.com] has joined #code
21:52 Vasi is now known as [R]
22:04 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
22:04 mode/#code [+qo Vornicus Vornicus] by ChanServ
22:09 ErikMesoy is now known as ErikMesoy|sleep
23:04 RichyB [richardb@Nightstar-86656b6c.cable.virginmedia.com] has quit [Ping timeout: 121 seconds]
23:28 Reiv [NSwebIRC@A3BDC3.5BE3EC.B8847E.5ADB9D] has joined #code
23:28 mode/#code [+o Reiv] by ChanServ
23:46 RichyB [richardb@Nightstar-86656b6c.cable.virginmedia.com] has joined #code
23:55 himi-cat [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds]
--- Log closed Mon Apr 29 00:00:30 2013
code logs -> 2013 -> Sun, 28 Apr 2013< code.20130427.log - code.20130429.log >

[ Latest log file ]