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. Put the SQL in a string and echo it, just like the example.
  4. 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"
  5. 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.
  6. 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....
  7. So where are you stuck?
  8. See the link in my signature on debugging SQL. You also need to sanitize your user input.
  9. 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?
  10. 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.
  11. Thanks Fenway! Should be no more than 5 children for each parent so I think it will work then!
  12. String concatenation is with . not ,
  13. Echo it at each point you use it, and find out where your problem is.
  14. Like I said. If it inserted into the DB, then it was escaped. When you query your database what do you see??
  15. If it inserted correctly then it DID escape. What is the string you're inserting?
  16. $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.
  17. 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
  18. 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.
  19. 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.
  20. You didn't save the results of the unseralization into a variable. You *WERE* doing that before, so...
  21. You didn't state what your problem or question is.
  22. 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.