Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Help building a query string (MySQL)

$
0
0

I am unsure as to the best way to do this. 
 

I am building a query using the following loop:

 

for($i=0;$i<count($data); $i++) {
	$query .= "'{$fileop[$i]}', ";
}

 

My problem is, at this point in the loop, I do NOT want $fileop to output its contents (it is not even defined yet).

Rather i need $fileop to display exactly as is, so that the variable name is stored in the string rather than its value at this point in time. I do however want the value of $i to output within the brackets. 

 

I suppose what im asking is, is there a way to nullify store $fileop within a string so that I can call it later (within another loop) and have it actually reference the value when the query is called?

 

(or maybe im just ass backwards here and should take a different approach to this whole section)


Viewing all articles
Browse latest Browse all 13200

Trending Articles