Vettel Posted December 16, 2009 Share Posted December 16, 2009 At the moment I have the following code: $tables = array(); $rows = mysql_query("SHOW TABLES FROM {$database}"); while ($row = mysql_fetch_array($rows)) { $tables[] = $row[0]; All this is doing is getting a list of all the tables in a MySQL database, and then putting them into an array. And that's all fine, but now I just need some help doing the next thing, which I know should be very straight forward- I'm just novice I need to take each of the values in this array and simply use them as if they were "normal" variables. Basically all I want to do is take each value ($tables) and plop them into a bit of code like this: $hs = @file_get_contents('http://website.com' . $tables); rest of code... I'm sure this is quite simple if you know even slightly more PHP than me- I think I've deduced that you use loops. But I don't know how to write this myself. Many thanks in advance, Vettel. Link to comment https://forums.phpfreaks.com/topic/185303-should-be-really-simple/ Share on other sites More sharing options...
trq Posted December 16, 2009 Share Posted December 16, 2009 foreach ($tables as $table) { $hs = @file_get_contents('http://website.com' . $table); // rest of code } Link to comment https://forums.phpfreaks.com/topic/185303-should-be-really-simple/#findComment-978208 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.