Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. You sure do.
  2. You wouldn't create a page for each product. Instead you could list all the products on 1 page with a link that passes that products ID number to another page and then extract the appropriate information. So in your example on the first page, we'll call it product_list.php, you could have: include("dbconnect.php"); $result = mysql_query("SELECT * FROM products") or die(mysql_error()); while ($row = mysql_fetch_array($result)) { echo "" . $row['productname'] . " "; } ?> Which will list all the product names and pass the ID, of what product the user clicks, to product.php. Therefore only needing 1 page to describe the particular product. And then on product.php, where you could extract information for the desired product (whatever the user clicks on): include("dbconnect.php"); $id = $_GET['id]; $result = mysql_query("SELECT * FROM products WHERE productid = $id") or die(mysql_error()); $row = mysql_fetch_array($result); echo "Product ID: " . $row['productid'] . " Product Name: " . $row['productname']; } ?> I think this is what you're looking for.
  3. Take out the while loop: $row = mysql_fetch_array($result); echo $row['productname']; ?>
  4. Just Google, "php open source web applications" and I'm sure you'll find something. Good luck.
  5. Oh, lol, your wording confused me. I believe the most appropriate terms would be either, 'recipient' or 'beneficiary'.
  6. Maq

    update(+1)

    There's not need for a function to do this. Just update the column by adding 1 to it.
  7. Looks like you solved this but, you didn't mark it [sOLVED] so... You can use single quotes for attributes inside a double quoted string: $homepage = file_get_contents('http://www.weather.gov/alerts-beta/al.php?x=0'); echo ""; echo $homepage; ?>
  8. What do you mean call?
  9. Sorry, I don't understand what you want. All records for max/min mileage?
  10. I see. Anyway, that's just my opinion, I'm not one with a great sense of style and design skills anyway.
  11. I think it's workable. - Center the entire site. - Maybe a little more red (vampires) and a little less yellow. - Move your left nav up, it's pushed down. - The header has nothing to do with the theme of the site. You have vampire, ghosts, zombies and werewolfs with a banner that has smoke towers, buildings and a sunset. IMO, it just doesn't fit. - I like the background images for the vampire lore, ghost lore etc... - Overall I think it's decent, a couple tweaks here and there and it should be fine. Good luck.
  12. Try: $sql="SELECT R.ZIPCODE, R.DATE, R.RESULTS, Z.CITY, Z.STATE_NAME FROM RESULTS R LEFT JOIN ZIPCODES Z on (Z.ZIPCODE=R.ZIPCODE) ORDER BY DATE DESC LIMIT 25"; I cleaned and shortened up your code a bit. Your style of SQL queries is odd, hard to follow. Anyway, I think you needed a left join and you weren't declaring what tables you got what column from. PS - This is a MySQL related question, not PHP.
  13. And what's your question?
  14. I'm not sure how to restrict the quantity of a specific error but you should take a look in the manual: error_reporting(). Good luck.
  15. Yes, go to the PHP Help section and search for "fiel upload". There are a ton of people who have similar questions. One in particular I came across: http://www.phpfreaks.com/forums/index.php/topic,245953.0.html
  16. Ahhh, much better. One thing that caught my eye. You have too much padding in between the center container and the 2 sides. You see how your left and right containers have like 5px padding, you should do the same with the center so it fills out. The color scheme looks much better. Try to fill out the top right banner part, it looks very empty. Just 3 lonely drop downs... I think it's a big improvement.
  17. Yeah sorry, didn't really notice that. Here: if(isset($_POST['submit'])) { $input = $_POST['input']; $whitelist = array(1=>'word1', 2=>'word2', 3=>'word3'); if (in_array($input, $whitelist)) { $sql = "UPDATE phpbb_user SET gword" . array_search($input, $whitelist) . "='$input' WHERE user='MM_Username'"; echo "UPDATE Successful Query: $sql"; } else { echo "$input is invalid..."; } } ?> </pre> <form action="<?php%20echo%20%24_SERVER%5B'PHP_SELF'%5D;%20?>" method="POST"> <
  18. Implode returns a string, you need to use array_unique on an array (explode).
  19. Yes, you need AJAX. And please remember to use the tags to properly format and color your code.
  20. W/e, they are just general terms.
  21. Why not just add them in at the final print?
  22. Yes definitely do that. We have an excellent website critique section and a beta testing section as well in case you want to test some functionality and whatnot. Good luck
  23. That shouldn't be the case, are you the owner?
  24. What exactly are you going to do if there are duplicates, remove them? If you want to remove then use http://us3.php.net/array_unique If you want to check if there's something in an array use: http://us3.php.net/in_array Hope that helps.
  25. Classes PHP Libraries
×
×
  • 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.