Jump to content

Should be really simple...


Vettel

Recommended Posts

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

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.