Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. I personally just use error_reporting & ini_set. What I would do to figure out which one it is, create a .php file with an error, and change one of the .ini files. Run the .php file and if there's not an error, change the next .ini on the list. Repeat.
  2. You should write your own code rather than using code you don't understand. If you got this code here, and didn't understand it, you should have asked for an explanation. Write out the logic of what you're trying to do. Don't use the existing comments or code, just write down how it should work logically.
  3. I'm not sure if that was supposed to be sarcasm, but I didn't fix the code, just the indenting, so it was readable. Legible? Whatever. I left the line I believe to be causing the problem in there.
  4. I'm curious do you think that's actually what the OP is talking about? I've never heard of that before in relation to php/mysql.
  5. A string in double quotes will be parsed. There is information about this in the manual. http://www.php.net/manual/en/language.types.string.php#language.types.string.parsing If you don't have any variables within it, and especially if you plan to use double quotes like in HTML, use single quotes. If you plan to have apostrophes, or variables that you want to parse, use double quotes.
  6. I told you twice where the problem is....
  7. Tuple? Is that like... tables? Or purple? Or turtles?
  8. What you're trying to do is not anything special. Get the text in the field, send it to the php page, save to the session. It's not any special function.
  9. You don't see an error because you're not checking for an error. mysql_query mysql_error Have you TRIED with a join?
  10. It's a malformed SQL statement. DELETE FROM users WHERE emailactivatie.mail = users.mail That statement will produce an error. You're not checking for errors, or you'd see it. you can't access the table like that. You could do this with a JOIN.
  11. Here it is with correct indenting. It's fairly obvious that it will create it twice. The "//if we've reached here" part will ALWAYS be "reached". <?php if(isset($_POST['submit'])){ $productId = $_POST['productId']; $quantity = $_POST['quantity']; $size = $_POST['size']; $color = $_POST['color']; $price = $_POST['price']; //if the productID doesn't exist, just create it: if ( !isset($_SESSION['cart'][$productId]) ) { $_SESSION['cart'][$productId] = array(array('quantity' => $quantity, 'size' => $size, 'color' => $color, 'price' => $price)); } //product already exists, check to see if it's the same as another in the group: foreach ( $_SESSION['cart'][$productId] as &$product ) { //NOTE: If you want to override pricing with new tiers, you can remove 'price' from this comparison. You may also want to // fetch prices from the database when you DISPLAY the cart if you do bulk discounts if ( $product['price'] == $price && $product['color'] == $color && $product['size'] == $size ) { $product['quantity'] += $quantity; } } //if we've reached here, the productID is already in the cart but the current item is not a duplicate of an existing one: $_SESSION['cart'][$productId][] = array('quantity' => $quantity, 'size' => $size, 'color' => $color, 'price' => $price); foreach($_SESSION['cart'][$productId] as $prod => $value){ echo $value['size'] .' '.$value['price']; } //print_r($_SESSION['cart']); } ?>
  12. The comments don't match the logic. Did you write this code?
  13. Why do you want to delete them? Generally, you don't delete data like this. It just causes problems later on. Furthermore, you haven't posted what the problem is. As it is, your script should produce syntax errors, and you never do anything with the data you selected.
  14. Rather than actually deleting the records, have a column with their account status (0=inactive, 1=active) and update that. One query.
  15. Or just do the math... you don't need to store the answer if you do math, or any logic. What is the second letter of hello? Easy with logic. What is 2+2? Easy with logic.
  16. It's hard to tell because of the messed up indenting, but you have this line " $_SESSION['cart'][$productId][] = array('quantity' =......." twice. Comment your code and figure out why it's twice.
  17. Your question doesn't make any sense. Try again,.
  18. Try jQuery's ajax functions. They have tutorials on their site.
  19. $answer = $result['answer']; I don't get why if you can echo it, you can't assign it....
  20. 1. Use code tags (The # button) 2. Tell us what doesn't work.
  21. What do you have so far? We can help debug the code but you should write it yourself. You already wrote the logic, now just convert it to code.
  22. Try doing it not in a string. If you're doing it for every single hour, you're doing something wrong with your logic.
×
×
  • 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.