-
Posts
422 -
Joined
-
Last visited
-
Days Won
1
Everything posted by awjudd
-
DateTime Fatal error: Uncaught exception 'Exception'
awjudd replied to webguy262's topic in PHP Coding Help
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 -
http://dev.mysql.com/doc/refman/5.0/en/delete.html Look at the part in the documentation about deleting with JOINs. ~juddster
-
Show value of multiple invalid input in textarea
awjudd replied to IreneLing's topic in PHP Coding Help
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 -
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
-
Show value of multiple invalid input in textarea
awjudd replied to IreneLing's topic in PHP Coding Help
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 -
Please mark the topic as complete. ~juddster
-
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
-
How to find certain parts of text within a file?
awjudd replied to VarHyid's topic in PHP Coding Help
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 -
Need help from a PHP accountant LOL
awjudd replied to Freedom-n-Democrazy's topic in PHP Coding Help
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 -
Need help from a PHP accountant LOL
awjudd replied to Freedom-n-Democrazy's topic in PHP Coding Help
Yes it is a help forum, but we assume you have done your due diligence in doing at least some debugging beforehand. ~juddster -
And the errors are? ~juddster
-
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
-
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
-
Need help from a PHP accountant LOL
awjudd replied to Freedom-n-Democrazy's topic in PHP Coding Help
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 -
Then in your first query remove blab_type from the SELECT because it isn't a valid field. ~juddster
-
Look closely at the () in the line you posted. You are missing a ) ~juddster
-
<?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
-
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
-
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
-
if ($_SESSION['cart']['content']['id'] == $_POST['id']) { Should be: if ( isset ( $_SESSION [ 'cart' ] [ 'content' ] [ $_POST [ 'id' ] ) ) { ~juddster
-
@vulture - the exit / die isn't required
-
What is it doing instead? ~juddster
-
$_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
-
How to get the last 30 days data from mysql database in php?
awjudd replied to angel1987's topic in PHP Coding Help
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 -
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