Jump to content

anthonydamasco

Members
  • Posts

    92
  • Joined

  • Last visited

    Never

Everything posted by anthonydamasco

  1. what does $prevCat = why is it blank? I get the logic you are suggesting, I just don't know how to get fill in the if (subcat4 = prevcat) info wait, i get it, let me try it out
  2. Hola I have a while loop issue that is driving me crazy - I have a database with the columns | Category | Subcat 1 | Subcat 2 | Subcat 3 | Subcat 4 | Productname under "sub cat 4" I have this data: Red Star Red Star Red Star Red Star Red Star BioSpringer BioSpringer BioSpringer BioSpringer AEB Yeast AEB Yeast AEB Yeast AEB Yeast I need to display products that are under "subcat 4" only mentioning "subcat 4" once then displaying all products below it, when the subcat 4 changes to the next result i needs to change. Example below. Red Star product product product product BioSpringer product product product product AEB Yeast product product product product product My code $sql3 = "select product_id, product_name, subcategory_4 from products where category = '$category' and subcategory_1 = '$subcategory_1' and subcategory_2 = '$subcategory_2' and subcategory_3 = '$subcategory_3'"; $query3 = mysql_query($sql3) or print "<font>insert error: " . mysql_error() . ". SQL was $sql"; $num_rows_top3 = mysql_num_rows($query3); if ($num_rows_top3 !== 0 ) { $sql4 = "select distinct subcategory_4 from products where category = '$category' and subcategory_1 = '$subcategory_1' and subcategory_2 = '$subcategory_2' and subcategory_3 = '$subcategory_3'"; $query4 = mysql_query($sql4) or print "<font>insert error: " . mysql_error() . ". SQL was $sql"; $m = 0; $q = 0; while (list($subcategory_4_loop)=mysql_fetch_row($query4)) { $m++; if ($m == 1) { echo "<br /><div class=\"product_nav_right_header padding_bottom_15\">$subcategory_4_loop</div>"; } #List all the products within this statement. while (list($product_id, $product_name, $subcategory_4)=mysql_fetch_row($query3)) { if ($subcategory_4 !== $subcategory_4_loop) { $q++; if ($q == 1) { echo "<br /><div class=\"product_nav_right_header padding_bottom_15\">$subcategory_4</div>"; } } echo "<a href=\"product_detail2.php?product_id=$product_id&id=$k\" class=\"right_side_link\">$product_name</a><br>"; } #end while loop What my code is doing is: Red Star product product product product BioSpringer product product product product product product It's not listing any subcategory after the first 2 - I know it's because of my counter - but I can't think of any other way to do it. Any help would be great
  3. You guys rock! Thanks - worked, headache is finally going away
  4. the email server might just be REALLY slow also
  5. call your host and raise hell, or get a new host, uploading in pieces is just going to get you corrupt files. Or find another host and just use them as file storage.
  6. make sure that the server is that you are using is setup for server email.
  7. Alright Simple problem. I am storing measurements in a database (feet/inches) so here is the issue. database field "measure" = 2' 9" $dem = $my_row['measure']; echo $dem; Result: 2' 9 how do i echo the string with the quotes at the end?
  8. Alright, I'm trying this method, how do i post this to create the "$colours" variable
  9. im getting an error when trying to use that code Parse error: syntax error, unexpected '{' on this line: if ( isset($_POST['colors']) && is_array($_POST['colors']) {
  10. how would i set up the array to use this? sorry, im still a little junior
  11. thats, but that doesnt seem to work either, http://pattersonflynnandmartin.com/advanced_search.php when you search with any color checked, it seems to ignore the "AND collection like '$collection'
  12. Hey, Here is my query "SELECT * FROM products WHERE collection LIKE '%$collection%' AND construction LIKE '%$construction%' AND match1 LIKE '%$match1%' AND wheremade_e LIKE '%$wm_en%' AND pattern LIKE '%$keyword%' AND sku LIKE '%$keyword%' AND color_e LIKE '%$Beige%' OR '%$colorall%' OR '%$Black%' OR '%$Blue%' OR '%$Brown%' OR '%$Gold%' OR '%$Green%' OR '%$Grey%' OR '%$Neutral%' OR '%$Red%' OR '%$Rust%' OR '%$Seafoam%' OR '%$White%' AND fiber LIKE '%$fiberall%' OR '$Wool' OR '$Silk_and_Wool' OR '$Sisal' OR '$Cotton' OR '$Mixed' LIMIT $eu, $limit" the posting page has check boxes for each color, the only color that is actually being called is "beige" if i check any other color check box i get no results. Obviously there is something wrong with my query. any suggestions?
  13. thanks guys I just have one more question. I have an dropdown <select name="collection"> <option value="" selected="selected">All Collections</option> <option value="Altair">Altair</option> <option value="Alto">Alto</option> </select> -- $collection = $_post["collection"]; -- SELECT * FROM products WHERE collection = '%$collection%' if someone chooses "All collections" i want all collections to display. what value should be set under "all collections"
  14. Hello All, I'm writing an advanced search results page for a website. It's pretty simple except the front end team decided to put a lot of check boxes on the posting page. (I'll simplify everything to make the situation ez to understand) So I am constructing a query to pull information from the columns collection construction color_e match and I have variables $collection $construction $red $green $blue $yellow $match Alright so the query needs to be something like Select * From products Where Collection LIKE '$collection' AND construction Like '$construction' AND (color_e like '$red' OR color_e like '$green' OR color_e like '$blue') And match like '$match' The part im having trouble with is the "(color_e like '$red' OR color_e like '$green' OR color_e like '$blue')" part, i want to pull results from any row that has the colors equal to what is being requested. they colors are check boxes so if they are unchecked they equal "XXXXXXX" and if they are checked they equal the color value assigned. Any help?
  15. Hello, I am taking a college course for javascript and I'm stuck on an assignment. I need to write an if/then statement that is declaired by the url in the address bar. If - url in address bar = www.princetonuniversity.com/index.html Then - display <html> home page </html> ELSE If - url in address bar = www.princetonuniversity.com/about.html Then - display <html> about us page </html> Can someone give me an example on how to write this script?
  16. Hello, I'm a web designer working with a company that needs a website similar to myspace. I'm pretty good with php, so recreating a bootleg version of myspace doesnt seem to hard. However The one element that I am not familiar with is creating folders with PHP. For example a user signs up, and they create a domain name "www.myspace.com/domain" well creating a separate database and all that is easy,but how to I create that folder and php files that need to go inside that folder to create there profile? Any help would be great thanks!
  17. I will make the question easier. I need to make this work www.sourcinglanes.com/school.html any advice?
  18. Hello! I'm new to ajax, so I'm a little stuck. I'm trying to allow customers at my website ad and remove things using radio button options, like on apple.com example: http://store.apple.com/1-800-MY-APPLE/WebObjects/AppleStore.woa/6854002/wo/8j1dO7obD8Pr2mNB2c91eJaJyvt/1.?p=0 Can anyone give me a point in the right direction, maybe if there is a similar script out there I can look at.
  19. where on php freaks are tutorials for this? I can't seem to find them
  20. Hello! I'm just looking for some advice. I need to setup a custom ecommerce website, and It needs to function like the apple store. Radio buttons that change price as you add parts without reloading the page. Example: www.apple.com/buildpcform Is php capable of this, and where can I find web resources that will help me learn how to this? thank you!
  21. It's still doing the same thing to me after I tried escaping from php <?php $conn = mysql_connect("localhost","www2","accuoffice") or die ( mysql_error() ); $db = mysql_select_db("ACCU") or die ( mysql_error() ); $search=$_POST["search"]; $result = mysql_query("SELECT * FROM phonelist"); $num = mysql_num_rows($result); if ($num == "0"){ echo "Please revise your search."; }else{ while($r=mysql_fetch_array($result)) { $phoneid=$r["idphonelist"]; $name=$r["name"]; $ext=$r["ext"]; $dept=$r["department"]; $cell=$r["cellphone"]; ?> <table width="515" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF"> <tr> <td><table width="515" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="178"><?php print $name; ?></td> <td width="40"><?php print $ext; ?></td> <td width="212"><?php print $dept; ?></td> <td width="85"><?php print $cell; ?></td> </tr> </table></td> </tr> </table> <?php } } ?>
×
×
  • 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.