0

Hi

I am trying to get to download images into a file from database field urls onto my server as there is lots of them. I think im on the right track.

I currently have an error

Parse error: syntax error, unexpected T_STRING in getimages.php on line 11

Hope someone can help with this please.

<?php
mysql_connect("localhost", "X", "X") or die(mysql_error());
mysql_select_db("X") or die(mysql_error());

$query = "SELECT * FROM TABLE";

$result = mysql_query($query) or die(mysql_error());
while($file = mysql_fetch_array($result))
{

$image = file_get_contents(' . $file[' . image . ']. ');




$path = 'images/' . $file[' . image . '] . ';
file_put_contents($path, $image);

}
?>
2
Contributors
2
Replies
11
Views
4 Years
Discussion Span
Last Post by mpc123
0

Line 11:

$image = file_get_contents($file['image']);

Line 16:

$path = 'images/' . $file['image'];

Edited by pritaeas

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.