Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. A. Most people aren't going to download files. It's risky. B. If you help people on here, you should be able to tell that your post of "It's not working" isn't going to get a good response. Read the links in my signature on getting help. What isn't working? what have you done to debug it? What is different between the old and new? Post the relevant code in code tags and answer these questions and you will have much better luck.
  2. Your first post says: [0] => Array # This is the room number So either you have a room # 0 or you've messed up when structuring your array.
  3. Thanks for the link, mostly because it has this at the top: "The SELECT syntax description (see Section 13.2.8, “SELECT Syntax”) shows the INTO clause near the end of the statement. It is also possible to use INTO immediately following the select_expr list." So I go back to my very first thought which is one of those variables is empty, producing the ''. Probably the one surrounded by them in the first place.
  4. Your code doesn't say echo $sql anywhere. And when you pasted the error here did you change it to username or are you trying to connect with 'username'?
  5. I do, but no one will listen to me.
  6. I could be wrong. If he'd done any debugging on his own like echoing the query it would help. Because THAT ERROR indicates a DIFFERENT issue. Which is why I said echo the query. But I'm talking to myself now.
  7. Well he understood it. The query is malformed. The right way is "SELECT * FROM $tblName INTO OUTFILE '$backupFile'" There is a big difference. It appears he does also need to select a DB according to this code. It's possible he left that part out when copying it, because I don't think MySQL would return the error it did if that were the case.
  8. Read the SELECT syntax. The order in which you put clauses is important. Hint: FROM is nowhere near the end of it. INTO OUTFILE is. But I feel like you didn't even try what I said...
  9. echo the query along with it and you'll see it. The code you've posted shouldn't produce that error. Edit: Oh yes it will. You have two possible issues. Read this: http://dev.mysql.com/doc/refman/5.0/en/select.html
  10. I would say on the orders table, make it possible for an order to have a NULL or 0 customer id. If so, require them to enter their order number to view the order. Link the shipping/billing table to the order number and customer id, so if no customer id you can use the order number. Lots of websites do this. It's not that hard.
  11. Just wanted to say I have done that before and it is perfectly valid, as long as it's a valid property on the object. It does work. Your assumption is correct.
  12. Also I moved the topic since it's now Java.
  13. And I have absolutely no problem with that I do it occasionally when something is challenging. But I have no idea if this person wanted PHP, Java, Javascript, or what. So...
  14. Okay here is a.php. <?php session_start(); ?> <form action="b.php" method="post"> Item 1: <input type="text" name="item[1]"> <input type="submit" value="add"> </form> <form action="b.php" method="post"> Item 2: <input type="text" name="item[2]"> <input type="submit" value="add"> </form> <?php print '<pre>'.print_r($_SESSION, true).'</pre>'; And here is b.php <?php session_start(); if(isset($_POST['item'])){ foreach($_POST['item'] AS $key=>$item){ $_SESSION['cart'][$key] = $item; } } print '<pre>'.print_r($_SESSION, true).'</pre>'; echo '<a href="a.php">Back to a.php</a>'; ?> Now try this and see what your print_r of session is after adding product 1, then product 2, and going back to a.php each time. This code is not tested. I used the foreach in b.php so you could do multiple products at once. If you are never going to do multiple products at once you could have 1 text input with just "item" as the name, and another hidden input with the id if you need it. The processing would have to change.
  15. How do you know it's not there? Your code now is only showing the post array not session. I'm on the phone when I get back to my desk I will type an example.
  16. So where is the problem? Do you want to add them one at a time by pressing many buttons, or all at once? Don't forget to have session start on EVERY page
  17. You can have two elements in one form. However, if you want them to click the buttons separately for each, then it was working. You need to more clearly explain your problem because I think it is very different from the way others are interpreting it. I was suggesting using an array in your session. IE, whenever a form is posted and you have a new item, add it to your $_SESSION['cart'] array. There are a lot of tutorials out there on shopping carts.
  18. Edit: I misread your last post. Either way.
  19. I missed that too. I still think your query is wrong. I don't think you can ++ a column. I've always done column=column+1
  20. It sounds to me like you should look into something like TinyMCE.
  21. Have you tried running the query in phpmyadmin? I'm pretty sure that query would fail.
  22. Yes, it could be done in PHP. However, you've posted in client side help, which is typically HTML and Javascript. Java is a completely different language. Furthermore, it doesn't sound like you have any code to work with. If your friend is stuck on his Java code, he would probably get more help posting his code in a Java forum. If it's Javascript, he can post it here in our Javascript forum. But keep in mind no one is going to write it for him. He can get help figuring it out. Where do you live that ATMs have anything other than twenties?
×
×
  • 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.