HI
I am trying to create folders from database, but get this error as im trying to make folders named field1-field2-info
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING on line 8
<?php
connection blar
connection blar
$query = "SELECT field1, field2 FROM Table";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result))
{
$dirPath = "' . $row['field1'] . '-' . $row['field2'] . '-info";
$result = mkdir($dirPath, 0755);
if ($result == 1) {
echo $dirPath . " has been created";
} else {
echo $dirPath . " has NOT been created";
}
?>