Jump to content

awjudd

Staff Alumni
  • Posts

    422
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by awjudd

  1. What is the value $teacher -> meta_value being returned? It looks like it has some invalid characters in it from reading the error message (invalid in the sense that they aren't correct for a Date Time. Can we see a sample echo of the value? ~juddster
  2. http://dev.mysql.com/doc/refman/5.0/en/delete.html Look at the part in the documentation about deleting with JOINs. ~juddster
  3. I'm not sure what you mean for the error section. Did you want it to have a list like: error 123456 error 1234567 etc? Or something else? ~juddster
  4. You need to add a WHERE clause to your query restricting it to only selecting the one row that you want (depending on their logged in information). ~juddster
  5. In your "error" section where you echo "error" also echo the $cells value? As for counting the total number of successful add an incrementor that adds 1 every time it was successful and then outside of your foreach loop echo that value. Does this make sense? ~juddster
  6. Please mark the topic as complete. ~juddster
  7. Yes it is very different. Are you sure you weren't using the shorttags echo? <?= $test ?>. The ; means end of the current statement and is a core element for many languages. ~juddster
  8. You could use: http://simplehtmldom.sourceforge.net/ to parse the DOM and then use each of the elements to grab what you want out of it. ~juddster
  9. Echoing variables is due diligence and stepping through each to see what the values are is due diligence. Reading over code it is incredibly easy to miss. ~juddster
  10. Yes it is a help forum, but we assume you have done your due diligence in doing at least some debugging beforehand. ~juddster
  11. And the errors are? ~juddster
  12. That statement means nothing to us. We need more information if you want us to help. That said, in my last post I defined the exact problem. ~juddster
  13. Because you still just appending to the end of the array when you should be doing as I said and: $_SESSION['cart']['content'][$_POST['id']] = array ('id' => $_POST['id'], 'size' => $_POST['size'], 'quantity' => $_POST['quantity']); ~juddster
  14. You keep overwriting the same variable ($sizeltotal). Please Note: this is a very easy thing to find through debugging using print statements ... i.e. echo each of the values you are totaling up and see what they actually are. Instead of coming here for us to debug it for you. ~juddster
  15. Then in your first query remove blab_type from the SELECT because it isn't a valid field. ~juddster
  16. Look closely at the () in the line you posted. You are missing a ) ~juddster
  17. <?php require_once("functions.php"); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> td { border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #30C; border-right-color: #30C; border-bottom-color: #30C; border-left-color: #30C; } </style> </head> <body> <form action="" method="post" name="catalog"> <?php DatabaseConnection(); $query = "SELECT * FROM treats"; $result_set = mysql_query($query) or die(mysql_error()); $i = 0; $output = "<table>"; while ($row = mysql_fetch_array($result_set)) { /* Do we need a new row? */ if ( $i % 2 == 0 ) { /* Yes, so output the table row stuff */ $output .= ( $i != 0 ? '</tr>' : '' ) . '<tr>'; } $output .= "<td width=\"400px\">" . $row['product_title']."<br /> ".$row['product_Description']."<br />" .$row['price'] . "<br /> Quantity: <input name=\"quantity\" type=\"text\" size=\"2\" /> </td>"; ++$i; } $output .= "</tr></table>"; echo $output; ?> </form> </body> </html> ~juddster
  18. You need to call mysql_fetch_array a second time to get the next set of information for that column. $row is only updated with the next bit of information once you assign it a value (i.e. $row = mysql_fetch_array ( $result_set ); ) EDIT: Can this topic be moved to PHP help because this has nothing to do with MySQL. ~juddster
  19. Figure out how the images are being stored on site a (i.e. the filenames and locations) and then use that on site b to generate the links? ~juddster
  20. if ($_SESSION['cart']['content']['id'] == $_POST['id']) { Should be: if ( isset ( $_SESSION [ 'cart' ] [ 'content' ] [ $_POST [ 'id' ] ) ) { ~juddster
  21. @vulture - the exit / die isn't required
  22. What is it doing instead? ~juddster
  23. $_POST[id] will give you a warning (if you have error reporting displaying them) because it has to automagically convert id to 'id'. If you have a $_POST'd value that has a space or anything in it (i.e. $_POST [ 'foo bar' ]) then it won't work. You should always use the quotes rather than not because it is incredibly slower (about 4 times). ~juddster
  24. Then that is the problem. BETWEEN will only work how you want it if the columns are DATETIME. You should do as Pikachu2000 said to insert the dates in then it should work. Assuming you change the data type to DATETIME. ~juddster
  25. http://php.net/string More specifically this piece right here: '$_POST[id]'. That will always return the same value. if you echo it you will see that it is saying $_POST[id] exactly how you have it. <?php session_start(); if ($_SESSION['cart']['content']['id'] == $_POST['id']) { $_SESSION['cart']['content'][$_POST['id']]['quantity'] = $_SESSION['cart']['content'][$_POST['id']]['quantity'] + $_POST['quantity']; } else { /* You were just appending it to the array but you are doing a search for it above so you need the actual id as the index */ $_SESSION['cart']['content'][$_POST['id']] = array ('id' => $_POST['id'], 'size' => $_POST['size'], 'quantity' => $_POST['quantity']); } echo '<DIV class="result">Added to cart.</DIV>'; ?> ~juddster
×
×
  • 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.