//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value.
$stocksymbols = $wpdb->get_results( "select meta_value as symbol from ii_postmeta where meta_key = 'symbol' and meta_value not like '% %' and meta_value not like '' group by meta_value order by meta_value asc");
foreach ($stocksymbols as $k=>$v) { file_put_contents('../stocks/stocksymbols.txt', $v, FILE_APPEND); }
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value.
seems like something fundamental is missing or wrong. I tried this as well...
PHP Code:
$stocksymbols = $wpdb->get_results( "select meta_value as symbol from ii_postmeta where meta_key = 'symbol' and meta_value not like '% %' and meta_value not like '' and meta_value not like 'Multi' group by meta_value order by meta_value asc");
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value.
stdclass cannot be output directly to a string.
In the file_put_contents, use $v->symbol instead of just $v.
Using a print_r on that example you have here should still write the output as it would with any print_r(x, true) call. That would indicate to me that you may be looking at the wrong file (you have used 2 different filepaths here). It is also possible that your function call includes an empty slot for the array, and since the file_put_contents you have here doesn't use append it will overwrite it every time. You'd be better off using var_dump instead of print_r since you could tell if its empty or null or what it is.
Needless to say, use the $v->symbol instead of $v in the put or write calls.
1) Leaving it days at a time before coming back
2) Ignoring things that people say.
Scroll up. I gave you a reply, then Fou-Lu replied correcting me. I went back and edited my post to tell you to ignore my reply and go with Fou-Lu's. Despite that, you've come back days later and still gone with my old and wrong advice, completely ignored my edit and completely ignored Fou-Lu.
If you're going to ignore people like that then what do you expect?
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value.
No paamayim nekudotayim is for scope resolution. You have a class named symbol, so you cannot use it in the foreach as you have. That would require the variable $symbol (or a public static property in the symbol class), and the $Value['symbol'] would be replaced by $symbol->symbol.
Note the -> is inside the loop. Fou was quite clear about stating this must be changed in the file_put_contents() line of code. I also put in my edit (you know, the red box in my reply that says edit) that you must change ['symbol'] to ->symbol. Why did you then decide to change => to -> on the foreach line instead?
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value.