Jump to content

Could somebody please help me with mysql request


spenceddd

Recommended Posts

Hello,

 

I can't seem to get this request to work, I have looked around for an answer but  I asm new to php and cannot get my head around it.

 


$query_relatedItems = "SELECT img01 FROM PortfolioItems WHERE id=103"; 
	$relatedItemResult = mysql_query($query_relatedItems, $dbc) or die(mysql_error());
	echo $relatedItemResult['img01'];

 

Any help appreciated!

 

Thanks

 

Spencer

you're missing a step

  $query_relatedItems = "SELECT img01 FROM PortfolioItems WHERE id=103";
      $result = mysql_query($query_relatedItems, $dbc) or die(mysql_error());
    $relatedItemResults=mysql_fetch_assoc($result);  
    $relatedItemResult=$relatedItemResult[0]; 
      echo $relatedItemResult['img01'];

 

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.