Jump to content

trying to get a literal string value from a variable


fotobleu

Recommended Posts

im trying to get data from a certain cell in the row

 

this is what i have so far

 

<code>

$chosenPath = 'fotos_thumbpath'; //default

if($thumbSize == 'S')
{
	$chosenPath = 'thumbpath';
}
else if($thumbSize == 'M')
{
	$chosenPath = 'thumbforsale';
}
else if($thumbSize == 'L')
{
	$chosenPath = 'fotopath';
}

echo $row[$chosenPath];

</code>

 

on the echo statement nothing gets displayed, i checked the db and there is data in those rows, i think it has something to do with

the $chosePath variable, any ideas?

 

thanks in advance

 

regards

 

-daniel

here is the whole code

$result = $dbObj->Query("select fotos_title, fotos_pnr, fotos_thumbpath, fotos_date from fotoblog_fotos order by fotos_date desc limit ".$settingsRow['config_rssAtomCount'].";");


//find out which thumbnail selected to generate
$thumbSize = $settingsRow['config_rssAtomThumbSize'];



$chosenPath = 'fotos_thumbpath'; //default

if($thumbSize == 'S')
{
	$chosenPath = 'fotos_thumbpath';
}
else if($thumbSize == 'M')
{
	$chosenPath = 'fotos_thumbforsale';
}
else if($thumbSize == 'L')
{
	$chosenPath = 'fotos_fotopath';
}

///echo $row[$chosenPath];

if(mysqli_num_rows($result) > 0)
    {
	while ($row = mysqli_fetch_assoc($result)) 
	{

		//$pathToRSSThumb = fixFotoPath($row[$chosenPath]);
		$pathToRSSThumb = $row[$chosenPath];
		//echo "rss thumb path ".$pathToRSSThumb.'<br/>';
		$echoStr .= '<item>
			         <title>'.$row[fotos_title].'</title>
			         <link>'.$headCode.$dname.'?pnr='.$row[fotos_pnr].'</link>
			         <description>
							<img src="'.$headCode.$dname.'/'.$pathToRSSThumb.'">

							<br />
					 </description>
			         <pubDate>'.date('c',strtotime($row[fotos_date])).'</pubDate>
			         </item>';
	}
}

$echoStr .= '</channel></rss>';
echo $echoStr;

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.