Guest Posted February 1, 2003 Share Posted February 1, 2003 I have been searching to no avail for the php code neccesary to pull product info from the database, so as to display them (the products from a specific catagory) outside the OSCommerce environment. Basically, i am stumped at the PHP necessary to select from the various tables. To descibe it in another fashion: I want to list products from catagory x, by date, on a new .php page on my server. The neccessary "select from X, where Z, and Y = blah blah blah" is beyond my ability with SQL at the moment. I do appreciate any help on this matter. Thanks Quote Link to comment Share on other sites More sharing options...
Guest Posted February 1, 2003 Share Posted February 1, 2003 There is a contribution called Randomize Anywhere and it should give you a good bassis for your modifications. Quote Link to comment Share on other sites More sharing options...
Guest Posted February 1, 2003 Share Posted February 1, 2003 thanks sooooo much :) Quote Link to comment Share on other sites More sharing options...
Guest Posted February 1, 2003 Share Posted February 1, 2003 I just looked it over and found that there is no provisions for specifying the products catagory. Do you or another member know what changes are neccessary to the following code to filter (hard code is fine in my application) by product catagory? // create SQL statement$sql = "SELECT * FROM `products` ORDER BY RAND() LIMIT 1"; Quote Link to comment Share on other sites More sharing options...
Guest Posted February 1, 2003 Share Posted February 1, 2003 Take a look at the query that the product_info.php page uses to select a product. that should get you started. Quote Link to comment Share on other sites More sharing options...
Guest Posted February 1, 2003 Share Posted February 1, 2003 well, i tried and tried to no avail. I don't expect anyone to help me out here, but I would be tremendously grateful to anyone who could. Quote Link to comment Share on other sites More sharing options...
Guest Posted February 1, 2003 Share Posted February 1, 2003 ok, it looks like i figured it out.. I am going to spend the rest of the night cleaning this up, but here is the first draft. mysql_select_db($database_shop, $shop); $query_productlist = "SELECT * FROM products_to_categories, products, products_description WHERE products.products_id = products_to_categories.products_id AND products_to_categories.categories_id = 35 AND products.products_id = products_description.products_id ORDER BY products.products_date_added"; $query_limit_productlist = sprintf("%s LIMIT %d, %d", $query_productlist, $startRow_productlist, $maxRows_productlist); $productlist = mysql_query($query_limit_productlist, $shop) or die(mysql_error()); $row_productlist = mysql_fetch_assoc($productlist); Quote Link to comment Share on other sites More sharing options...
hatimad Posted March 2, 2003 Share Posted March 2, 2003 Hi, anything happened about the thing? did you manage to get it work? i would like to see it please thanks in advance Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.