hi. im making an advertising site. and want images to my posts. i have gotten the image uploading and the posting to work. but im not sure how to solve it when im going to get my pictures out so it shows with the posts.
<?
$query = mysql_query("SELECT objects.objid, objects.headline, objects.text, objects.date, objects.price, users.name, users.email FROM objects, users WHERE users.userid = objects.userid ORDER BY objid DESC")or die(mysql_error());
while( $result = mysql_fetch_array($query) )
{
print '<tr><td><div id="box1"><strong>';
print $result['headline'];
if ( session_is_registered('UserLogin') )
{
print ' <a href="edit.php?newsid=' . $result['objid'] . '&action=editnews"><img src="bilder/button_edit.png" border=0 alt="ändra" title="ändra"></a> ';
print '<a href="delete.php?newsid=' . $result['objid'] . '&action=deletenews"><img src="bilder/button_drop.png" border=0 alt="ta bort" title="ta bort"></a> ';
print '<a href="picstore.php?newsid=' . $result['objid'] . '"><img src="bilder/pic.gif" border=0 alt="lägg till foto" title="lägg till foto"></a> ';
}
print '</strong>';
print '<p>';
print nl2br($result['text']);
print '<strong><br>Pris: ';
print $result['price'];
print ',-</strong></p></div><div id="spacer"> </div><div id="box2">';
! Here is where i want the pictures from my binary_data database !
print '</div></p></td></tr>';
}
?>
Here is the code im using to write out the posts.
i added so i get the objects.id from posts added to the pictures database binary_data.objectid so i want to bind them together through that. i have tryed to figure this out myself but however i do i get 2 diff result. either only the posts with pictures shows or post with several pictures shows as many times theres is picture added to it.
please help me solve this. ive tryed but im not skilled enough 🙂