Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 27th, 2005, 03:21 PM
Authorized User
 
Join Date: Jan 2004
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default Next Record, Putting Data in Table....Please Help!

I'm working with phpShop and can't get any answers on their site, so I'm thinking and hoping someone here will be able to help me...

What I'm wanting is a table with 2 columns, 3 rows in it...Without the duplicating of products. Here is the code that I have:

Quote:
quote:
<?php
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
/*
* Special Products Module
*
* @version $Id: mod_phpshop_featureprod.php,v 1.6 2004/12/06 21:08:08 soeren_nb Exp $
* @package Mambo_4.5.1
* @subpackage mambo-phpShop
*
* @copyright (C) 2000 - 2004 Mr PHP
// W: www.mrphp.com.au
// E: [email protected]
// P: +61 418 436 690
* Conversion to Mambo and the rest:
* @copyright (C) 2004 Soeren Eberhardt
*
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* mambo-phpShop is Free Software.
* mambo-phpShop comes with absolute no warranty.
*
* www.mambo-phpshop.net
*/
global $mosConfig_absolute_path;

/* Load the phpshop main parse code */
require_once( $mosConfig_absolute_path.'/components/com_phpshop/phpshop_parser.php' );

//maximum number of items to display
$max_items = $params->get( 'max_items', 2 );
$category_id = $params->get( 'category_id', null );

require_once ( CLASSPATH. 'ps_product.php');
$ps_product = new ps_product;
$db = new ps_DB;

if ( $category_id ) {
$q = "SELECT DISTINCT product_sku FROM #__pshop_product, #__pshop_product_category_xref, #__pshop_category WHERE ";
$q .= "(#__pshop_product.product_parent_id='' OR #__pshop_product.product_parent_id='0') ";
$q .= "AND #__pshop_product.product_id=#__pshop_product_categ ory_xref.product_id ";
$q .= "AND #__pshop_category.category_id=#__pshop_product_cat egory_xref.category_id ";
$q .= "AND #__pshop_category.category_id='$category_id'";
$q .= "AND #__pshop_product.product_publish='Y' ";
$q .= "AND #__pshop_product.product_special='Y' ";
$q .= "ORDER BY product_name ASC LIMIT 0, $max_items";
}
else {
$q = "SELECT DISTINCT product_sku FROM #__pshop_product WHERE ";
$q .= "product_parent_id='' AND vendor_id='".$_SESSION['ps_vendor_id']."' ";
$q .= "AND #__pshop_product.product_publish='Y' ";
$q .= "AND #__pshop_product.product_special='Y' ";
$q .= "ORDER BY product_name ASC LIMIT 0, $max_items";
}
$db->query($q);
$i = 1;

?>
<table align="left" width="130" rowspan="1" class="phplatest">
<tr> <?php
while($db->next_record()){
if ($i++ % 2)
$class="sectiontableentry1";
else
$class="sectiontableentry2";
?>

<td>
<?php
$ps_product->show_snapshot($db->f("product_sku"));
?>
</td>
<td> <?php
$ps_product->show_snapshot($db->f("product_sku"));
?>
</td>
</tr>
<?php
}
?>

</table>
Here is the link you can view it at: http://rs347.securehostserver.com/~meemmusi/us/

Thank you for any help you can give me!!!
 
Old July 28th, 2005, 02:38 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default


Do you need paging records script?

http://www.mediasworks.com/script/pa...rds_script.htm

 
Old July 28th, 2005, 04:32 PM
Authorized User
 
Join Date: Jan 2004
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hmmm....Where would I put that? I don't know much at all about PHP..






Similar Threads
Thread Thread Starter Forum Replies Last Post
Putting dynamic data into columns rashley XSLT 2 December 21st, 2005 12:03 PM
Trouble putting data into Excel Drop Down List Arsi C# 2 October 26th, 2004 11:47 AM
Putting generic content into table rows Blaise XSLT 0 May 21st, 2004 08:29 AM
putting xml data in a html <table> rev XSLT 4 September 10th, 2003 08:49 AM
putting data into a template Aaronwv VB How-To 3 September 10th, 2003 08:28 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.