Current location: Hot Scripts Forums » Programming Languages » PHP » display accessory according to model

display accessory according to model

Reply
  #1 (permalink)  
Old
Newbie Coder
 
Join Date: Oct 2008
Posts: 65
Thanks: 3
Thanked 0 Times in 0 Posts
display accessory according to model

hi all

I have "model" field in accessory category of product table which have values like

"E71,E72,E73,E74......"

On the "mobile product" page i want to match the model of accessories with model of

mobile and display them.


PHP Code:


/* query to select all models from accessories category from product table */

$qry_model="select * from product_table where category_id=4";
$qry_model_result=mysql_query($qry_model);
while(
$qry_model_row=mysql_fetch_array($qry_model_result))
{
$desc_model_all $qry_model_row['model'];
$desc_model_all explode(','$desc_model_all);

foreach (
$desc_model_all as $value
{
echo 
$value/* this outputs as E73E72 */
}
}

$mobile_model $row['model'];

if(
$value == $mobile_model/* problem starts here */
{

$qryc="select * from product_table where model = '$value' and category_id=4";

$resultc mysql_query($qryc);
if(
mysql_num_rows($resultc)>0)
{
// product detail is displayed here

what should i do ?

vineet
Reply With Quote

Featured Marketplace Scripts (view more)

  #2 (permalink)  
Old
Wannabe Coder
 
Join Date: Jul 2010
Posts: 137
Thanks: 2
Thanked 0 Times in 0 Posts
instead of categorieid =4
use categorieid = $id in the query
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 05:19 AM.
vBulletin® Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.