Skip to content

u/phoenix3d

In this archive from Dec 2010 to May 2013

0
posts
13
comments
0
media
20
score

INSERT IGNORE will do that, but krues8dr is right, PHP should be doing the work here.

I'd say use INSERT IGNORE as a failsafe, but it would be better (and faster, i believe), to assemble a list of all the urls you want to insert, and try to select them in an initial query, then process the results, remove the duplicates, the do the insert.

insert ignore should prevent the need for a table lock though, as it would catch any that are inserted in the time between your initial query and the insert.

2 points

INSERT IGNORE should not give you errors if a url is repeated, but since it's a unique index, you also won't get it inserted, unsure if that's your desired outcome.

also, since you're using prepared statements, there's no need to use escape_string() on your inputs.

2 points

note that _get() and _set() methods are significantly slower than directly accessing the method however.

I've been thinking about this issue of no "read-only" properties, and while I think they would be useful - here's the conclusion I came to: unless you're allowing random user code to run without significant checks (in which case, BAD!), there's no reason that a public property would change unless you wrote something to change it.

if a nefarious individual somehow did get to the point where they could change your public variable - then logically they can already run arbitrary code, and you're screwed no matter what.

1 points

stay away from frameworks until you have a very good grasp of the bare language - you don't want to be reliant on a framework.

the best way i've found to learn php is just to start building things, and keep php.net open. write simple things, maybe read up a little on some functions at php.net and rewrite things. start simple, build up.

of course as always, google is your friend.

4 points

not for plywood. this seems to me like an example of a marketing "expert", just out of marketing school, trying to "revitalize" a brand. unfortunately they forgot they were selling plywood, not an ipod. someone who's building a house or whatever doesn't care about how the plywood makes them feel.

just sayin'

-1 points

how is this a brilliant ad? it says nothing about the benefits of their plywood over a competitors, and beyond the "omg guys the wood looks like water and they put a boat there" it's pretty pointless.

from a design point of view i guess it's... original? i dunno, just seems pointless to me, and from an advertising point of view, there's nothing there that makes me want to buy their plywood, thus, it's a terrible ad.

-2 points

End of this list.

Back to top

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.