Zen Cart Logo
Forums / Contribution-Writing Guidelines / Code on OSC port not working...Help please

Code on OSC port not working...Help please

Locked

Views: 2,263

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
29 Oct 2007, 11:27 PM
#1
strelitzia avatar

strelitzia

Totally Zenned

Join Date:
Nov 2005
Location:
France
Posts:
588
Plugin Contributions:
1

Code on OSC port not working...Help please

I'm in the process of porting a module from OSC. I've managed to get to grips with the differences between zen structure and osc structure, and to date, a large amount of the port is complete. I have hit a brick wall with one particular section of code that is supposed to call 3 bits of info from the database, namely the products threshold, products name and products id, then display them, and give an option of editing or deleting the products. I have run the sql as a query in phpmyadmin and it returns the correct data, but it fails to display the output on screen in zen admin.

Code in question is:```php

<?php $gift = $db->Execute("select fg.*, p.products_id, pd.products_name from " . TABLE_CARROT . " fg, products p LEFT JOIN products_description pd ON (pd.products_id=fg.products_id) WHERE pd.language_id = '" . (int)$_SESSION['languages_id'] . "' AND p.products_id = fg.products_id ORDER BY fg.threshold ASC"); while (!$gift->EOF) { echo '<form action="gift_add.php" method="GET"><tr> <td class="smallText">$<input type="text" size="4" name="threshold" value="'.$gift['threshold'].'"></td> <td class="smallText">'.$gift['products_id'].'</td> <td class="smallText">'.$freeGifts['products_name'].'</td> <td><a href="gift_add.php?ID=' . $gift['products_id'] . '&action=delete">' . zen_image_button('button_delete.gif', 'Delete') . '</a> <a href="categories.php?pID=' . $gift['products_id'] . '&action=new_product">' . zen_image_button('button_edit.gif', 'Edit') . '</a></td> </tr></form>'; $gift->MoveNext(); } ?>

I have been looking for a solution to this all day and can't find a fix....perhaps i'm missing something obvious.

Can anyone point me in the right direction to fix this??

Thanks in advance
Steve
29 Oct 2007, 11:39 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: Code on OSC port not working...Help please

Try using the ->fields identifier:```
$gift[B]->fields[/B]['products_id']

30 Oct 2007, 12:05 AM
#3
strelitzia avatar

strelitzia

Totally Zenned

Join Date:
Nov 2005
Location:
France
Posts:
588
Plugin Contributions:
1

Re: Code on OSC port not working...Help please

Thanks a million Dr Byte. Worked a treat.
Now i can move on to fixing the next section of the port....making it display in admin/categories that it has been flagged as a gift.