Hey ive got a design question ive got a load of objects about 300 and ive got to convert an xml schema into my

Z/@y ne '10']"
I think my head about exploded

'/@y' ?

"Who set lwall and tchrist free in XPath?"

Didn't @foo used to be for attributes?

Select X if it has at least one preceding sibling named Z with an attribute y
that is not equal to 10.

Ah.

Sod one know of a PHP inventory system that's 5.0 capatiable

capatiable?

I imagine there are a few. I'd check freshmeat.

Are you trying to find an inventory system written in PHP5?

that whole sentences needs to be reworked
Yes
Jesus, I sound foreign… I can't hear myself type over this music

how would I grab the contents of a string between the { }?

Or how about "X[sum(foreach $a in @* return number($a)) 7]"?
php.net/preg-match
Yeah.

X with an attribute which is the sum of all the attributes of X?

X with attributes which sum up to less than 7
And then you have to account for documents with a type schema, because suddenly '10' != 10

Hey all, I'm looking for an array function that might not exist. I want to create a new array from certain keys of an existing array, for example: array_from_key_values($start_array, array('wanted', 'keys'))
uHey all, I'm looking for an array function that might not exist. I want to create a new array from certain keys of an existing array, for example: array_from_key_values($start_array, array('wanted', 'keys'))/u

I suppose I should say '10' ne 10

Ah yes, the joys of XML Schema.

php.net/array-splice
Or possibly array_filter(). It rather depends on how you're intending to define "keys I want".
Some days, it feels like Tim Bray climbed on my desk, dropped trou, and left a present…
Man, I hope he's using PHP to connect to a Sybase database somewhere. It's the only way I stand a chance of getting even.

Heh. Y'know that's my day job right now.
PHP/MSSQL 2k

I'm so sorry
I did everything I could…

It's all fine until I want to get useful errors out of stored procedures. :P

Unfortunately, I don't think anyone else has bothered to look very deeply at the stuff I wrote. I know Frank ran along the surface of it, but I don't get the impression anyone's ever done a deep dive.

'C').

I'd like to be able to some_function($array, 'bob', 'george') or some_function($array, array('bob', 'george'))

Well, let's go back to my earlier point. How do you intend to programmatically define "keys I want"?
In that case, I'd recommend array_filter()

Just as above, they'll be defined inline in the function call.

array_splice() is generally more useful for taking chunks of a numerically indexed array

array_filter operates on values, though, I want to operate on keys.
(I'm not adverse to writing my own function either, I just don't want to duplicate effort if there's already a good way)

php.net/array-keys turns keys into values
I just figured you could have found that one on your own

No, I understand that, but I don't think it gets me any closer… I want to go from one associative array, pull some key/value pairs out, and create a new associative array with those key/values.

i need help with a php script and recieving post variables… http://pastebin.com/m2feb9243

Basically, my function takes an array with a bunch of values in it, from that array I want to create a new array with certain values from the input array, in a certain order.
(I'm using that new array to create an SQL query with a function that takes queries with question marks in them and replaces them with values from an array.)

why on earth would you do that?

mode=1&user= looks like GET not POST to me ?

i suppose that could be… i've never used POST before.

Uh, which part? Replacing the question marks? Because I check for SQL Injection attacks at the same time. Easier than testing for them every time I do a query.

what are you pulling back from the query?

POST would have those in the body of the request, rather than in the URL
uPOST would have those in the body of the request, rather than in the URL/u

Not sure what you're asking, I use the question-mark-replacing-thing for every query I make.

Well, array_filter() can certainly do it, but it may be easier to construct your own instead. A simple foreach() with an inner "in_array" should suffice.

i'm not sending this information from another page, it's from a scripting function from within a video game. I don't know how to send more than one variable in post i suppose…

because how your doing sql is broken :-p

Ok, that's probably for the best. Just trying to make sure I wasn't missing an easier way.
How many languages have you done SQL from?

3
well 4 but i count all of .net as 1
regardless, no need for pissing contest; how your doing it is very unorthadox. Which in programming is strange.

No, I'm just curious, because this is how Python and Ruby at least do it by default.

array_diff_uassoc() could do it as well, but again - a foreach() will probably be more readable for most people.

And I was surprised to find PHP didn't, as it's got no built-in way to protect from sql injection.

That's not an accurate representation of Python's DB-API

Well, that bits of python I've used does that anyway, if I remember correctly.

I usually tend to build Models that extend an abstract Crud layer. So if I want to get user with the ID 12 i do $u = User

*
To prove that you're not a bot, enter this code
Anti-Spam Image

Comments are closed.


Blog Tags:

Similar posts: