Hello forums is ti possible to query a mysql db but the WHERE belongs to a multidimentional array : $doors = Array ( [links] => Array ( [0] => Array ( [text] => home ) ) ) SELECT *FROM doors WHERE links = multidimentionalarray([text] => home) // as you see "text" is not right after "links" is after the element "0" so I can not use WHERE link.text because the 0 any one? please
I'm not sure whether I understand the specifics of what you're asking, but you can burrow down into a multimensional array as follows: $sql = "select * from doors where links = '{$doors['links'][0]['text']}'"; PHP:
didn't work. ok if I run this query: SELECT links FROM table WHERE links != '' limit 2 Code (markup): it gives me this: Array ( [0] => Array ( [links] => Array ( [0] => Array ( [text] => At street ) ) ) [1] => Array ( [links] => Array ( [0] => Array ( [text] => At Home ) ) ) ) Code (markup): But I want to do a query where it only gives me where the [text] = "At Home" I tried SELECT links FROM table WHERE links.text = 'At Home' limit 2 but it does not work Thank you for you time and any help with this
I see. This is why posting more code helps - it was not clear what you were getting at. You must be using mysql_fetch_array(). If you are, then you will get a big array and have to work your way through it to get the values you need. You may wish to consider using mysql_fetch_assoc() and looping through the result set; it's more efficient for the server and there's less array gymnastics involved. The answer to your problem is easy but until you provide some more code and a description of the relevant database fields I cannot give you a concrete example.
You right, I was thinking to do all in one call and set a limit of 10 (this is just what I need) But using filters after the call is good too, I might have to use LIMIT 100, so I can get about 10 of what I need Thank you for your help, I added to your reputation.