You only need to create the cpmfetch object once before all your calls and close it once after. In between you can do as many calls to get images and stats that you want.
I suspect thats your problem
I agree that we can call it any no. of time , but as i told u i want 1 pic from each category in Horizontal line , but if i used your this code the first category comes in first line 2nd in 2nd line & so on all this executes in vertical manner
<?php
include "cpmfetch.php";
$objCpm = new cpm('/photos');
$objCpm->cpm_viewRandomMedia (1,4);
$objCpm->cpm_viewRandomMedia (1,3);
$objCpm->cpm_viewRandomMedia (1,35);
$objCpm->cpm_close();
?>
Again, I want to insert 5 pics in Horizontol way, so please suggest the best way.
A messy way that leaps to mind would be to do it in a table... this would yield tables in tables, but unless you are php-ready and want to code a bit to display the images, you can do:
<?php
include "cpmfetch.php";
$objCpm = new cpm('/photos');
?>
<table>
<tr>
<td><?php $objCpm->cpm_viewRandomMediaFrom(1,1,"cat=1"); ?></td>
<td><?php $objCpm->cpm_viewRandomMediaFrom(1,1,"cat=2"); ?></td>
<td><?php $objCpm->cpm_viewRandomMediaFrom(1,1,"cat=3"); ?></td>
<td><?php $objCpm->cpm_viewRandomMediaFrom(1,1,"cat=4"); ?></td>
<td><?php $objCpm->cpm_viewRandomMediaFrom(1,1,"cat=5"); ?></td>
</tr>
</table>
<?php $objCpm->cpm_close(); ?>
I cant remember if the "cat=1" should go before the 1,1 or not. Hmmmm
Anyway, the other way is to get back result sets and build your own img ref tag from it.
This will make a series of 1 image tables inside the table of 5 cells.
YAHOOOOO !!!!!!!
It Works Dear as it is !!!!!!!!!!!!!!
Ive PM u my site link , !!@#$ Please Suggest & Have Feel of your Hard work
THANKS DEAR