@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 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



Comments:

<0> what could i find and replace '.$PHP_SELF.' with that would be equivilant. i am open to suggestions
<1> altoid- Apache's auth should work well for that
<2> itrebal, therefore PHP_SELF is user input, you can use it if you escape it
<1> [sellout]- $PHP_SELF -> $_SERVER['PHP_SELF']
<3> my car doesnt even go atm, meh
<4> Davey|Work: gotchya, i didn't use it anyway
<5> Dragnslcr: thanks, googling now
<0> <trys> thanks Dragnslcr
<6> How can i make the content of a $var downloadble with the php header funcions or is this impossible ?
<7> IXB: Also, if someone didn't tighten up the bleeders or they have come loose you'll have low fluid and potentially air in the lines as well (VERY BAD THING)
<8> ovis: There is an example on the header() man page.
<9> hi guys - is there a limit on how much sql left joins are used?
<6> mmh iv been there
<10> phatbyte: i've done 20 table left joins.
<10> they aren't pretty but it's all up to the engine, not php.
<1> phatbyte- other than CPU/memory limits, I wouldn't think so



<8> phatbyte: Well, there's a sanity limit.. :)
<4> bignose_: maybe you should redesign that :/ ?
<9> hm ok cool thanks! ;)
<10> http://jeff.nationaltestingcenter.com/scratch/foo.phps k, there's me code and she won't work. on many machines. i think i'm following the docs correctly.
<10> itrebal: it's a legacy app, so it doesn't worry me any more.
<0> ok my syntax must be off..
<0> <form action="'.$_SERVER['PHP_SELF'].'" method="post">
<1> bignose_- <?php instead of <?
<0> parse error, unexpected T_ENCAPSED_AND_WHITESPACE
<10> Dragnslcr: that's not going to effect if this works or not.
<4> bignose_: "This function is EXPERIMENTAL. The behaviour of this function, the name of this function, and anything else documented about this function may change without notice in a future release of PHP. Use this function at your own risk."
<4> bignose_: you might have the syntax wrong, and teh docs dont refelct it
<10> itrebal: indeed. how should i be doing inserts then ?
<4> bignose_: with the real SQL syntax
<10> and pg_query ?
<4> yea
<10> okay, if i use pg_query_params will it do the quoting for me, or should i addslahes to each one of my array elements [those that are strings]
<4> you should use pg_escape_string
<11> hello
<0> could i fix all my php_self using script with $PHP_SELF = $_SERVER['PHP_SELF'];
<10> itrebal: is pg_insert supposed to do quoting.. ? maybe that's what i'm missing.
<9> hm theres a limit of 61 joins
<10> yeah you need to redesign if yer doing 61 joins :)
<3> how the hell have you managed to use 61 joins?
<0> ?
<1> I don't think 61 joins is a database design issue as much as a why-are-you-pulling-that-much-stuff-at-once issue
<1> ***uming the system actually is large enough to need 61 tables
<3> hmm
<9> i got the db from someone.. now i can mange it to get it running in php :/
<3> it would suggest that either you have one hell of a lot of data thats linked or that you made lots of tables for the sake of it
<10> itrebal: canyo show me how you'd write a basic insert statment, i can think of about a million waysto do it, none are elegant looking.
<4> bignose_: uhhh RTFM
<4> #sql
<10> [i'm used to perl. :)]
<4> SQL is the exact same
<10> i know that. here's what i mean.
<12> there is no php "version" of SQL.
<12> SQL is a defined standard.
<10> arg. let me type, you'll see waht i mean.
<8> Heh.
<3> something along the lines of insert into table (column, column, column) values (value, value, value)
<3> is prolly a reasonable way to do it
<8> The degree to which SQL can be called 'standard' is debtable, however.
<12> mattmcc: :)
<1> SQL is very standard. Nobody follows it exactly, though
<1> And the standard kinda ****s in a few places
<10> pg_query($dbh,"INSERT INTO foo (one,two,three) VALUES ('".pg_escape_string($one)."','".pg_escape_string($two.. yada yada.
<10> see, to me that's very ugly.
<12> some would say its not a standard if everyone has their own version of it.
<3> code is uaually ugly
<3> it looks fair enough, then again i dont use pgsql
<12> bignose_: use prepared statement
<12> surely pgsql supports those.
<10> compared to $dbh->do("INSERT INTO foo (one,two,three) values (?,?,?),undef,$one,$two,$three)) i'm not trying to make this a perl/vs php statement, just tyring to get my php to look a bit more elegant versus a hamfisted concatenation.
<12> bignose_: that's a prepared statement. That's what I told you to use
<3> well surely your actual SQL should be the same :P
<13> prepared statement isn't up to the database to support, but eh abstraction layer
<8> Eh?
<8> Real prepared statements are a feature of the databse.
<14> teh*
<8> All an abstraction layer can do is fake them.



<10> k, i'll start looking for how to prepare a statement.
<10> cause this is garbage :)
<2> PDO supports prepared statements :)
<2> (falling back to real prepared statements if the DB supports them, otherwise emulating them)
<12> I was just about to say that
<13> bignose_: I suggest using adodb, that way when you want to support a different db sevrer in the future it will be very little work
<3> mysql supports them...but none of the hosting space ive used ever has an up to date version :/
<10> ||cw: i don't support other database servers here. pgsql does all i need.
<13> Davey|Work: what do you mean "real"
<13> bignose_: for now...
<10> i apprecaite your comment, but in my environment it doens't apply.
<2> ||cw, real as in native to the RDBMs
<2> bignose_, take a look at PDO, it's a natice C PHP extension for PHP 5.x - really nice :)
<2> native
<10> ||cw the only thing above it as is see it is oracle, and i simply to not belive that greater than 5% of large businesses out there need oracle and my company does not target said businesses.
<2> it doesn't do *abstraction* of queries, just abstraction of DB apis :)
<13> Davey|Work: how would something like go into an engine? an API amybe, but that's just an abstration layer too
<10> Davey|Work: i will.
<2> ||cw, pardon?
<13> how would an rdmbs itself support prepared statements in this fashion?
<13> bignose_: I recomend adodb anyway, it's same some really great features that make using db api's in php a lot more sane
<12> ||cw: what do you mean how?
<2> adodb is *so* bloated
<11> help - i don't get it - &thorn; from c returned by htmlentities() but i need instead &thorn to have the code with #xxx - how the heck do i do that?
<13> fyrestrtr: I mean how would the protocol work that? seems kind of inefficiant
<15> db abstraction is a waste of resources... particuarly adodb
<3> is oracle free/open source?
<12> IXB: there is a free version of it.
<10> IXB: are you joking ?
<13> Davey|Work: and PDO doesn't work all that well. maybe it works well with pgsql, but it works like crap for mssql. adodb works well in all cases
<3> ah right, that explains it then
<10> so, guys given the above example of me creating an insert statement using concatenation,how would you do it without using pear or ado ?
<2> ||cw, I have no problems using PDO with MySQL, SQLite and PgSQL
<12> ||cw: I don't know about protocols, but I know that databases do support prepared statements "natively".
<12> *some* databases
<13> bignose_: sprintf could be workable. it's not as "smart" though
<2> ||cw, btw, the reason statements prepared in the RDBMS are better, is they are pre-optimized at that point too
<4> gah, this is weird....
<4> sin(18) is outputing -.750987
<13> Davey|Work: you mean like a stored proceedure?
<10> ||cw: i didn't even sorry consider sprintf. thanks. duh. ****.
<2> ||cw, yes, similar, but its a prepared statement ;)
<12> the only thing I know about prepared statement (other than how to use them) is that they are great for repeated inserts -- performance really goes up.
<13> Davey|Work: I think I see. kind of like an ad-hoc sp, maybe even per user connection
<2> ^^ that too :)
<2> ||cw, as fyrestrtr states, if you use the same prepared statement more than one, it is only compiled/optimized once
<12> heh, kinda like java servlets.
<13> bignose_: what about php.net/pg_prepare
<12> the initial request -- takes a bit, then its very fast on over other request.
<3> they help protect against injection attacks too
<12> mmm ... need a snack.
<12> brb
<0> $PHP_SELF = $_SERVER['PHP_SELF']; does not seem to be setting ? GET fars properly. nothing has any effect
<2> [sellout], uhm, $PHP_SELF wouldn't include them either
<2> you want REQUEST_URI most likely
<13> $_SERVER['PHP_SELF'] is just the file name
<13> and path
<13> or dies it have the path...
<16> http://ca3.php.net/manual/en/reserved.variables.php
<17> what's the best way to use the DOM with php?
<17> i.e. to select elements and their content and return them, with a nice API
<3> um...
<3> using XML i guess, but...
<18> ew, xml, hiss.
<17> I want to support even tag soup
<2> npx, erm, ext/dom, PHP 5
<17> what id like to do is drop a dom tree into dtree
<17> thanks davey1
<17> oneoneone =)
<0> hrm
<19> how can i get the mimetype of a file that exists on my filesystem?
<13> difeta: mime magic


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #php
or
Go to some related logs:

wx fileexist python
snd_pcm_dmix_open) unable to create IPC shm instance
postfix message_size
roguedaemon
Debian downgrade perl-base
no video source found tvtime
glibc update gentoo relocation error
#css
#perl
gentoo enemy-territory emerge amd64 wiki



Home  |  disclaimer  |  contact  |  submit quotes