Jessica
Staff Alumni-
Posts
8,968 -
Joined
-
Last visited
-
Days Won
41
Everything posted by Jessica
-
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.
-
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.
-
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.
-
Use the full path with the URL.
-
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.
-
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.
-
I told you twice where the problem is....
-
Tuple? Is that like... tables? Or purple? Or turtles?
-
Store form values in PHP Session variables before form is submitted
Jessica replied to traknet's topic in Javascript Help
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. -
You don't see an error because you're not checking for an error. mysql_query mysql_error Have you TRIED with a join?
-
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.
-
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']); } ?>
-
The comments don't match the logic. Did you write this code?
-
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.
-
Rather than actually deleting the records, have a column with their account status (0=inactive, 1=active) and update that. One query.
-
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.
-
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.
-
Your question doesn't make any sense. Try again,.
-
Store form values in PHP Session variables before form is submitted
Jessica replied to traknet's topic in Javascript Help
Try jQuery's ajax functions. They have tutorials on their site. -
$answer = $result['answer']; I don't get why if you can echo it, you can't assign it....
-
1. Use code tags (The # button) 2. Tell us what doesn't work.
-
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.
-
Try doing it not in a string. If you're doing it for every single hour, you're doing something wrong with your logic.