arrays!! aahhggggrrr
Posted: Sun Oct 04, 2009 10:11 pm
Hello, To anyone who could help me. I am trying to create an array that would hold file names ( just file names, not the full file path) specific to each user id. What I am trying to do is set up an if statement to either start an array or add onto an existing array from a mysql_query. I already know what should go in between the {} of each statement. I believe that it should be organized in such fashion:
I have used count( explode(',',$query) ), although if the field is empty it returns 1 (from what I have realized, because of the defined delimiter), compared to, if the field actually had one key (or in my case, one file name) within the array...that too returns 1. How do I define wither a field is empty or not in an if statement from a query? I would imagine this solves my problem if I can place something that can be defined in the if statement that would reflect wither the field is blank or not rather then how many keys are in the array .I believe their might be a better way around this that I just might not see.
any help on this would be great, thanks in advance!
Code: Select all
if( WHAT GOES HERE? ){
}
else{
}I have used count( explode(',',$query) ), although if the field is empty it returns 1 (from what I have realized, because of the defined delimiter), compared to, if the field actually had one key (or in my case, one file name) within the array...that too returns 1. How do I define wither a field is empty or not in an if statement from a query? I would imagine this solves my problem if I can place something that can be defined in the if statement that would reflect wither the field is blank or not rather then how many keys are in the array .I believe their might be a better way around this that I just might not see.
any help on this would be great, thanks in advance!