Jump to content

SocomNegotiator

Members
  • Posts

    106
  • Joined

  • Last visited

    Never

Contact Methods

  • AIM
    socomnego
  • MSN
    kb_hoopstar01@msn.com

Profile Information

  • Gender
    Not Telling

SocomNegotiator's Achievements

Member

Member (2/5)

0

Reputation

  1. This is my DB setup: products_sizing: sizingid sizingname value type hidden freesize 4 Large 1 absolute 5 X-Large 1 absolute 6 Small 1 absolute products: Of course I have productid, and all the other info about the product. Then their is a field called "sizing" This then has the id's of whatever sizing method (products_sizing) it has assigned to it. productid ....... sizing 1 4,5 Notice how a product does not have to have all the sizing methods. I am trying to figure out how to create an array to grab this information for each product automatically. This way I can use the array in a foreach to loop through a users selected products and show them which sizing option they can choose from for each individual product. Thanks so much for your help!
  2. Ok here is what I have come up with. The only problem with this code is that if I have more than one product the sizing methods for each product will be the last product to go through the loop. For instance, the first and second product will have the same sizing methods as the third even though the first and second product don't have the same sizing methods. Any ideas on how to fix this? Again this is a Smarty template, and I can use normal coding in the scripts. {foreach from=$ProdsCarts key=ProductID item=ProductRow name=ProductsLoop}//This goes through how many products there are. {if $ProductRow.sizing != ''} <tr class="head"> <td height="15" colspan="3" style="border:none;"><div align="justify">{#Sizing_Method#} ({$ProductRow.name})</div></td> </tr> <tr> <td colspan="2"> <div align="left"> {foreach from=$ProductSizing key=key item=isOn name=ProductsLoop} // This goes through the sizing methods. Right here I think is the problem. It does not associate with which product the sizing methods go with. <input name="sizingmethods" type="radio" id="sizingmethods{$SizingID}" value="{$SizingID}"/> <label for="sizingmethods{$SizingID}"> {$Sizing.$key.name} | {if $Sizing.$key.value ne 0} +{$Sizing.$key.value} {if $Sizing.$key.typename eq 'absolute'}{#CURRENCY#}{else}%{/if}{else} {#free#} {/if}</label><br /> {/foreach} </div></td> </tr> {else} {/if} {/foreach} Ideas????
  3. Sorry, yes I am using a template. It is Smarty. I can though input regular code into the scripts.
  4. I have a products table that has a field called sizing. The sizing field contains an ID from another table called products_sizing. The main reason for the sizing field in the products table is to decipher which products have what kind of sizing method. For instance, some products (shirts) only are available in small and medium not large, but others have the option for all three. In the products table the sizing field shows which sizing method a product will have if any. {foreach from=$SizingMethods key=SizingID item=SizingRow name=SizingMethods} {if (what query should go here to only show the sizing methods a certain product has?)} <input name="sizingmethods" type="radio" id="sizingmethods{$SizingID}" value="{$SizingID}"/> <label for="sizingmethods{$SizingID}"> {$SizingRow.name} | {if $SizingRow.value ne 0} +{$SizingRow.value} {if $SizingRow.typename eq 'absolute'}{#CURRENCY#}{else}%{/if}{else} {#free#} {/if}</label><br /> {/if} {/foreach} Thanks in advance!
  5. Sorry I did not specify...the script is in the sources folder, and I want the uploaded file to go to the hotsheet folder, which is in the files folder.
  6. I am trying to upload a file to a certain folder in my directory. However, the folder I want is not in the same folder as the file. This is what I have...Do I have the correct path? move_uploaded_file($_FILES["file"]["tmp_name"], "../files/hotsheet/" . $_FILES["file"]["name"]); echo "Stored in: " . "../files/hotsheet/" . $_FILES["file"]["name"]; Here is an example of my folder setup /html/ /files/ /hotsheet/ /sources/ file.php
  7. It's just not displaying anything...when in the DB I know there are items
  8. Do you see anything wrong with this code? I don't get this...a few months ago this iece of code was working fine, but now it does not work. I think that my host provider upgraded his PHP version or something. $ladders=mysql_query("SELECT item.id, item.name, pre_order.amount, DATE_FORMAT(pre_order.date,'%m/%d/%y - %H:%i') FROM pre_order LEFT JOIN item ON pre_order.item_id = item.id WHERE pre_order.user_id='".$user_id."'") or die(mysql_error()); while(list($id,$name,$amount,$date)=mysql_fetch_row($ladders)){ $out[body].="<tr><td align='center'>$amount</td><td align='center'>$name</td><td align='center'>$date</td></tr>"; }
  9. Ah thanks "The Little Guy" I hate all of this stupid stuff that php has!!!
  10. I have this code...it was working when I created the site like 3 months ago, but now it does not work. I get an error that says this "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1". Any help would be much appreciated. $res = mysql_query("SELECT * FROM `guide_order` WHERE user_id = '$userid' ORDER BY priority") or die('Error, query failed'); while($r = mysql_fetch_array($res)){ $db->query("INSERT INTO `order` (`order_number`,`pre_order_id` , `item_id` , `amount` , `user_id` ) VALUES (".$num.",".$r['id'].", ".$r['item_id'].", ".$r['amount'].", ".$r['user_id'].")") or die (mysql_error());
  11. Hmm...so there is no way to just get a module that will convert the text to the language selected. I know I would have to create something with the sessions so that it knows what language a user wants. But the default would be english and if they selected spanish then the text would change. Most of the text is not in a database. The site is mainly static html, but with a php framwork.
  12. Well I am not sure what to do with this. I have a client who wants their site to also be in Spanish. Well do I need to re-create the whole site in Spanish. Or is there some sort of module I can get that when the user selects the language the site will change accordingly.
  13. Yeah I think I understand the query...except for one thing ('".implode("','",$data)."') Why are their two commas? I know one to separate each value, but the other I am not sure...
  14. Yeah I need to read up on the whole implode thing. I use arrays, but I don't use them as often as I should.
  15. Sweet stuff that right there worked. Thanks a lot everyone for your help.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.