koolkedar
04-15-2012, 05:20 AM
Hi all
I am not sure how to do this with php.
I have two queries
$qry = "select * from product where productid='".$dlist."'";
$result=mysql_query($qry);
$subprodqry = "select * from subproducts where productid='".$dlist."'";
$subprod=mysql_query($subprodqry);
i am writting while loop
while($row = mysql_fetch_array($result) and $subprods = mysql_fetch_array($subprod))
{
}
within the while loop there is a point where i have to assign the values from 2nd array $subprods.
But the thing is while doing that i have three different records (product names), which i need to assign to 3 different product images. when i do that i get three different results
how can i do that do have to write another while loop for assigning the values. I am giving the code where i have to write it....
<td align="left" valign="middle" bgcolor="#4E8EB4" >';
echo " Product Name :-- '". $subprods["subPartName"]."'</td>";
echo '
<td rowspan="4" valign="top" bgcolor="#FFFFCC" ><!--DWLayoutEmptyCell--> </td>
<td align="left" valign="middle" bgcolor="#4E8EB4" >';
echo " Product Name :--'". $subprods["subPartName"]."'<!--DWLayoutEmptyCell--> </td>";
echo '
<td rowspan="4" valign="top" bgcolor="#FFFFCC" ><!--DWLayoutEmptyCell--> </td>
<td align="left" valign="middle" bgcolor="#333333" >';
echo " Product Name :-->'". $subprods["subPartName"]."'<!--DWLayoutEmptyCell--> </td>";
echo '
<td >
i want to put the sub product name from the $subprods array ,every image has its name so it will be assigned uniquely....how can i do that....same after the image is displayed and below that is the product code same way while loop and every product has product code which need to be displayed.
Thanks in Advance....
Help need is urgent...for my customer web site..
I am not sure how to do this with php.
I have two queries
$qry = "select * from product where productid='".$dlist."'";
$result=mysql_query($qry);
$subprodqry = "select * from subproducts where productid='".$dlist."'";
$subprod=mysql_query($subprodqry);
i am writting while loop
while($row = mysql_fetch_array($result) and $subprods = mysql_fetch_array($subprod))
{
}
within the while loop there is a point where i have to assign the values from 2nd array $subprods.
But the thing is while doing that i have three different records (product names), which i need to assign to 3 different product images. when i do that i get three different results
how can i do that do have to write another while loop for assigning the values. I am giving the code where i have to write it....
<td align="left" valign="middle" bgcolor="#4E8EB4" >';
echo " Product Name :-- '". $subprods["subPartName"]."'</td>";
echo '
<td rowspan="4" valign="top" bgcolor="#FFFFCC" ><!--DWLayoutEmptyCell--> </td>
<td align="left" valign="middle" bgcolor="#4E8EB4" >';
echo " Product Name :--'". $subprods["subPartName"]."'<!--DWLayoutEmptyCell--> </td>";
echo '
<td rowspan="4" valign="top" bgcolor="#FFFFCC" ><!--DWLayoutEmptyCell--> </td>
<td align="left" valign="middle" bgcolor="#333333" >';
echo " Product Name :-->'". $subprods["subPartName"]."'<!--DWLayoutEmptyCell--> </td>";
echo '
<td >
i want to put the sub product name from the $subprods array ,every image has its name so it will be assigned uniquely....how can i do that....same after the image is displayed and below that is the product code same way while loop and every product has product code which need to be displayed.
Thanks in Advance....
Help need is urgent...for my customer web site..