Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. The fact that he's using AND as the delimiter for implode should through a red flag though. AFAIK you cannot do field = (value1 AND value2) - for one, it's not the right syntax, and secondly a single column CANNOT be BOTH value1 and value2. OP, you can use IN() and use a comma as the delim.
  2. There's absolutely no reason to be using Word to write your PHP scripts, you really should use an IDE. Which begs the question as to what you consider to be your development environment... What application are you pasting it into? Most people do their development IN the development environment such as a local host, or write the code in an IDE and FTP it to the dev server.
  3. The problem is the extra comma.
  4. Put the SQL in a string and echo it, just like the example.
  5. If you don't already have the messageTo user's name, then yes. You need to give the table an alias, so it would be like this SELECT gn_messages.*, CONCAT(to_user.userFirstName, ' ', to_user.userSurname) AS to_full_name, CONCAT(from_user.userFirstName, ' ', from_user.userSurname) AS from_full_name, FROM gn_messages INNER JOIN gn_users to_user ON to_user.user_id = gn_messages.messageTo INNER JOIN gn_users from_user ON from_user.user_id =gn_messages.messageFrom WHERE messageTo = $messageTo AND messageDeleted = '0' ORDER BY messageDate DESC"
  6. YOU NEED TO CHECK FOR ERRORS IN YOUR SQL. YOU NEED TO USE ONLY ONE QUERY AND I WROTE IT FOR YOU. NOT A SEPARATE FUNCTION JUST OOOOONNNNNEEEEE QUERY. I CAN'T MAKE IT ANY CLEARER THAN THAT.
  7. That's really vague. It's not like you can just plug in a few lines of something, you're going to have to write a lot of code. You can't be stuck on the ENTIRE project....
  8. So where are you stuck?
  9. See the link in my signature on debugging SQL. You also need to sanitize your user input.
  10. You'll probably want to set up a MySQL database to store your users and their budgets. Will this be for one user only or many users with separate budgets? And will it be something they use one-time and enter everything at once, or will they come back and enter their expenses as they spend them? Are you including income as well?
  11. You've posted this in the wrong section, this forum is for questions and comments about the PHP Freaks website. I'm moving this to application design, since you have no code and it sounds like you haven't even started.
  12. Thanks Fenway! Should be no more than 5 children for each parent so I think it will work then!
  13. String concatenation is with . not ,
  14. See, it worked...
  15. Echo it at each point you use it, and find out where your problem is.
  16. Like I said. If it inserted into the DB, then it was escaped. When you query your database what do you see??
  17. If it inserted correctly then it DID escape. What is the string you're inserting?
  18. Oh well that changes everything.
  19. $times = 1; $numbers = htmlspecialchars($_POST["postnumber"]); $count = 1; for ($times =1; $times <=12; $times++) { $result = $times*$numbers; if ($_POST["answer" . $times] == $result) { echo '<li>'; $count++; echo ($times . " X " . $numbers . " = " . $_POST["answer" . $times] . " " . '<strong>Correct! Well done!</strong>' . '<br/>'); echo '</li>'; } else { echo '<li>'; echo ($times . " X " . $numbers . " = " . $_POST["answer" . $times] . " " . '<strong>Incorrect! Try again!</strong>' . '<br/>'); echo '</li>'; } } Now $count holds the number of correct ones. Change the variables names to be more descriptive.
  20. Do you have a mail server installed? Did you real the manual on mail()? Did you set your sendmail_path correctly? ignore that. Windows doesn't come with a mail server AFAIK. Google is your friend: http://books.google....windows&f=false
  21. What does it output? Did you check your junk mail? Are you hosting this or using a paid host? Do they have a mail server? Does mail() return true or false? A third-party library like PHPMailer might help in the long run.
  22. Well you have $times for that. You have two variables that right now hold the exact same values throughout your entire script. Change one of them to be useful.
  23. You didn't save the results of the unseralization into a variable. You *WERE* doing that before, so...
  24. You didn't state what your problem or question is.
  25. So once you unserialize that string, it will create ANOTHER object. Try doing a print_r() on the new object to see what properties it has for you to access.
×
×
  • 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.