Jump to content

Help building a query string (MySQL)


KirkLogan

Recommended Posts

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)

Link to comment
https://forums.phpfreaks.com/topic/275250-help-building-a-query-string-mysql/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.