I have a problem with getting MySQL column into php array variable , for further foreach()
cycling.
Here is my code:
$files=array();
$filesFetch = "SELECT FileName FROM articledata";
$rs=mysql_query($filesFetch);
while($rd=mysql_fetch_object($rs))
{
$files[]=$rd->files;
}
if (!$files) {
die('getting filenames failed');
}
foreach ($files as $key => $id)
{ //... do the stuff }
I am not getting stopped at the die
condition, but my error says:
Notice: Undefined property: stdClass::$files
I assume there is problem with formatting, because this error notice repeats :"rowCountTimes"
Also this error appears for the line.
$files[]=$rd->files;