logs archiveIRC Archive / Freenode / #php / 2006 / May / 25 / 1
TML
Stormchaser: I'm more of a hyper-realism guy. Misfile, Alpha-Shade
NSGN: SQLite
richardlynch
NSGN: Consider SQLite
TML
richardlynch: STFU
NSGN
hm...i have to say i'm not familiar
Dangermouse
lol
Stormchaser
TML: what about vgcats? :)
TML
Riding my bandwagon. Who do you think you are, anyway?
Jymmm
TML: Search The Funky Universe?
TML
Jymmm: Stop The F***ing Usurpation
         

NSGN
somebody mind giving me a nutshell idea of what it is?
TML
That's right, everyone get out your dictionary.
Stormchaser
NSGN: nope.
Dangermouse
Usurpation, what a funky a word
TML
NSGN: php.net/sqlite
arpad
wow, what an ego
richardlynch
(Action) abashed
Jymmm
TML: Fuck the dictionary, I'm looking for the online spoken .wav file!
Dangermouse
LOL
TML
arpad: I'm fairly certain richardlynch knows I'm joking.
richardlynch
(Action) actually, he didn't, but [shrug]
arpad
because sarcasm is renowned for travelling well over irc?
Fushuing
Jymmm: will .ape work too?
richardlynch
NSGN: http://php.net/sqlite
Jymmm
Ah, here we go... http://m-w.com/dictionary/Usurpation
TML
arpad: Because richardlynch has been here a lot before.
richardlynch
(Action) now feeling really stupid for missing previous link from TML...
Fushuing
STUPID richardlynch
richardlynch
Reading email and doing IRC at same time is Stupid, isn't it?
Fushuing
you are ultra-stupid :|
         

Jymmm
Fushuing the only thing I have that uses the ext .ape onlt deals with CAD/CAM tyvm
Fushuing
your stupidness even amazes stupidity itself that it comitted suicide by slicing its throat off while jumping off a skyscraper
TML
arpad: It's not as if sarcasm is a personality trait I developed in the last 15 minutes.
maxo
thanks for all your help, goodbye
Jymmm
TML 17.3424 minutes ago
NSGN
oh this is nice.... "Call to undefined function: sqlite_open()"
richardlynch
NSGN: You'll have to compile it in (Un*x) or uncommont the sqlite line (Windows) -- and you have to be using recent version...
lilkid
TML: sorry for the delay, but yes the query works perfectly
TML: oops
wrong person
richardlynch
NSGN: If the file is relatively small, array_walk might be faster/easier
NSGN
richardlynch: the current server i'm tergeting is a virtual server, and i cant control what is compiled for it
:-/
richardlynch
NSGN: Yeah, just go with array_walk then, and be done with it.
NSGN
durn
ok
lilkid
TML: oh my bad right person, yeah the query works fine
NSGN
hm, i wouldnt be able to throw a wildcard in array_search...would i?
TML
lilkid: I didn't ask if the query worked
lilkid: I asked if you've confirmed that it's actually arriving in that block of code
lilkid: There are several branches right there
lilkid: Before we debug the branch that runs the query, let's make ABSOLUTELY SURE that we're even getting INTO that branch
richardlynch
NSGN: array_walk is gonna call a function with each element -- you can put the wildcard into the body of the function. I think you also get a bonus argument to pass in whatever you want.
KimmoA
TML and arpad: Thanks again for your solutions.
NSGN
ah screwit, i just realized i can forget line returns and use implode/explode
Jymmm
serialize()
lilkid
TML: i made a new var $this->error = $row['userid']; when echo'ing it echo's the right value from the database.
richardlynch
NSGN: Careful -- You want to watch out for "am" and "spam" as words... You'll want to be checking for word boundary with preg_match, and implode+preg might be more expensive than array_walk... Doubt it, but worth checking.
lilkid
TML: let me just check as you said if its getting into that black
s/black/block
NSGN
richardlynch: maybe i'm dense...but whats wrong with those words?
richardlynch
NSGN: Nothing, except it would be super easy to be looking for "am" and find "spam" after you implode the file contents.
NSGN
oh i see
got ya
richardlynch
NSGN: Been there, done that. :-)
lilkid
TML: ok thanks for your help, accidently placed the else statement on the wrong if statement >.<
JJPeerless
ok..im having trouble connecting to my sql database.. In cpanel my username is peerless so when I created the database it has the peerless_dbname as its name. And then I created a user, peerless_username is how it came out. So when i connect to the database..do i use (localhost,peerless_username,pass) or do I use (localhost,peerless,pass)
bullrage
peerless_username
and select the database as peerless_dbname too
JJPeerless
yea..thats what im doing
still not working
damn
for pass..i use the username pass i made..not my cpanel pass..right?
bullrage
the password you made when creating peerless_username
JJPeerless
yea.
everything seems right to me
the only thing i think that could be wrong is localhost
this is set up on a VPS server
and my peerless cpanel account is on a different ip then the main shared ip
is that why maybe?
itrebal
JJPeerless: sounds like you should be reading cPanel documentation
Stormchaser
!+g10
php-bot
Guideline #10) We don't support script(s). We help you *write* PHP, not recommend or download and install/hack/modify/adapt/use pre-written scripts
samuel
anyone know if its possible to query mysql after executing a query to find out what the newly added primary key is?
richardlynch
Jymmm
JJPeerless: You have been asked MANY times not to use the enter key as puncuation, please stop.
richardlynch
JJPeerless: You may also want to examine the output of SELECT * from mysql.user -- and visit http://dev.mysql.com
Rockj
btw, is it normal that each time you do a query you have to reopen the connection to the database? or is it normal to make connection open for a longer period? oO
richardlynch
Rockj: One connection per script, or you'll kill performance badly.
bullrage
blah, i've just knocked a whole kb and a lot of lines from my script using mysql_num_rows and mysql_fetch_row
Rockj
richardlynch: hum, I'm wondering what im coding wrong then. Need to take a closer look on the mysql_* functions and how they work.
bullrage
richardlynch: does that mean it would be easier to store the database connection in an include file, and just include that file to open a connection?
nevermind, stupid question
richardlynch
Rockj: Pastebin your script, maybe we can spot it in seconds...
Rockj
richardlynch: I have a database class and a user class. Ill pastebin it .. 2 sec.
richardlynch
bullrage: Yes, and put the include file OUTSIDE the webtree to help protect MySQL password.
bullrage
richardlynch: Any other suggestable places to store it?
Stormchaser
bullrage: Any other database.
urf... nm
richardlynch
bullrage: In root-read-only httpd.conf, but then never ever dump out $_ENV or use phpinfo() ...
Stormchaser
lol
bullrage
Those 2 are the only ways of protecting the contents of the file?
Rockj
richardlynch: will you be around for a while? I have to go pickup a friend that is comming to city
theotherlight
help: im trying to replace an instance of $word that's not within "<abbr(nothere)>", but this: "/[^(<abbr(.*))]({$word})[^(.*)>(.*)]/", doesn't seem to work
anyone have any ideas?
richardlynch
bullrage: Not only, just best, imho.
Rockj: Somebody will be around.
Stormchaser
bullrage: ...or encrypt it
Rockj
richardlynch: she just arrived so have to stick and pick her up but here the two classes, but you might need to view whole page to understand how I use it? User class: http://rockj.pastebin.com/735930 Database: http://rockj.pastebin.com/735929
bullrage
I presume the config.php files that store the database usernamd and password in them for different forums and blogs are encrypted?
Rockj
Ignore some stuff in the database, like the use of the global in the constructor.. I've changed it abit and havent cleaned up..
itrebal
bullrage: why would they be encrypted?
richardlynch
bullrage,Stormchaser: Things is... If they can get to source, they can figure out how to unencrypt, as it's right there in the source.
bullrage
itrebal: Well they don't get uploaded outside of the webtree, and I was wondering how they did it..
itrebal
ah
syle
when i try to call the same function i'm inside, the return value gets screwed after it recurses on the function? and fix for return ?
s/and/any
Stormchaser
richardlynch: ha?
syle
only thing i can think to do is use break; and set the return value as a global idk
richardlynch
syle: Hunh? Maybe you want to return an array of all the answers from the recursion??? return array_push(samefunc($args), $results);
Rockj
richardlynch: just do changes in pastebin and messages here on irc with my nick as prefix. (as they get autologged) be back in a while =) or notes for what I should change and so on.. Thank you very much. Appriciated.
bullrage
richardlynch: what other methods would you suggest then?
richardlynch
Rockj: will do
syle
richardlynch not really, what function is doing is generating an id, checking it against database, if it exists, recurse till it gets a unique one
richardlynch
bullrage: Switch to a new host that lets you have a directory outside the webtree to put include files where they belong? All I got.
syle
so all it is a basic if else statement with return's in them
samefunction($loopnumber); basically
richardlynch
syle: Just do an insert and then use http://php.net/mysql_insert_id -- You WILL screw up if you try to anticipate the next ID.
limepilot
what is wrong with the contact form code? http://pastebin.com/735940
bullrage
richardlynch: haha. I've already got files outside the webroot. :)
syle
beleive me its from 1mill to 9mill which is pretty safe i think
richardlynch
bullrage: So put the mysql_connect include outside too.
syle
besides the point though
richardlynch
syle: Not safe enough.
syle
whats unsafe is using autoincrement as a username
so not an option
richardlynch
syle: Nobody said your unqiue key and the return of mysql_insert_id HAS to be an auto_increment...
Stormchaser
autoincrement.. as... username...
syle
mysql_insert_id will not pick a number between 1 mill and 10 mill for me, so i just want to figure out why return isnot working
richardlynch
Rockj: http://rockj.pastebin.com/735946
syle
autoincrement is fine, if your using that as an id to base deletes etc on, but i need unique ids between those ranges that are random
Xyphoid
what's your code look like, syle?
I do that occasionally when wanting random order IDs that aren't sequential
why are you recursing? i'd just loop
cythrawll
syle instead of doing that why don't you use uniqid()
and set the database field to unique key?
uniqid(microtime(),1)
TML
Putting a unique key on the field and catching failed inserts is a far better way than trying to "select/if exists, select again".
theotherlight
can someone help me with regex? im trying to match $word as long as it's not between "<abbr" and "</abbr>" but im having trouble, this is what ive got so far: /[^(<abbr)]{$word}[^(<\/abbr>)]/
syle
hows that different that generating one with rand and checking it exists already or not
TML
syle: The latter has (what should be) an obvious race condition
« prev 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 next »