I'm successfully connecting to the database, and successfully pulling data and displaying it using db2_fetch_array and db2_fetch_both. The code below works just fine
$file="m03slsd0";
$file=db2_escape_string($file);
$query="SELECT slgrpn,slfrkn,slftyp,slfsze,slpqty,slpwht,slentp,slkplt FROM HUTALIB.$file";
$quepre=db2_prepare($conn,$query);
$quexe=db2_execute($quepre);
while($row=db2_fetch_both($quepre))
{
$det=$row[0];
if($det!='')
{
printf($det."</br>");
}
}
The problem comes up when i'm changing the index to column name in db2_fetch_assoc() or db2_fetch_array() - the code below prints nothing.
while($row=db2_fetch_both($quepre))
{
$det=$row['slgrpn'];
if($det!='')
{
printf($det."</br>");
}
}
Any suggestions?
Thanks in advance