Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. Maybe if you hadn't added the extra slashes to your first post, I could have seen the actual problem. When you posted it, you posted with one slash, then added the others later. No wonder. You need to turn off magic quotes.
  2. You haven't given us enough information to help you. And you definitely don't understand how escaping certain characters works. You MUST have a \ in front of a quote in order to submit that quote within a string. That's what escape_string DOES. It adds the slashes. (It does some other stuff too). When you send it to SQL, it knows you mean "TJ's" because the \ ESCAPES the ' so it can see it as INSIDE the string, not ENDING the string. I suggested a solution, and you didn't bother to try it or tell us you did, you haven't told us WHY you think it's not working, you haven't shown any data or error messages. Why would anyone be able to solve your problem when as far as you've stated it THERE IS NO PROBLEM.
  3. It IS SEARCHING FOR TJ'S. Jesus Christ.
  4. It DID. That's why there's a \ in it.
  5. You NEED the escape in there, so that it doesn't break your SQL statement. Try using LIKE('%$str%') instead. If the name isn't EXACTLY the same = won't match it.
  6. You can't use date() for that, you have to use some simple logic. Instead of using ceil() use round, and if it's 0 then set it to 15.
  7. You could also do it like this: $seconds = $end-$start; $minutes_rounded = ceil($seconds/(60*15))*15; echo $minutes_rounded; If you never need the actual minutes just the rounded up version.
  8. Because you said if the minutes aren't 15 minute increments you wanted it rounded up to the next 15!
  9. You need to make an attempt, and we can help you fix any bugs. If you want someone to write it for you post in Freelancing.
  10. I've recently switched for most things. I still use Fx for some stuff.
  11. = is assignment. == is comparison. You also need to move the $price1 part BEFORE your if, and the total part AFTER. Go read each line and say what it does in English. It's obvious why you're getting duplicate amounts. You're telling it to add and multiply twice. Also, '.07' is a string. Try using a NUMBER.
  12. Did you even try my code before asking again how to do it? add a round() around the $seconds/60 and it will be rounded. The rest of it should be fine.
  13. There's nothing in your code that tries to add tax. you need to make an attempt at it. Show us the code that you had problems with. FYI: 7% is 0.07 of the total.
  14. Code Igniter is fairly old. I recently tried to use it for a project and found it to be very frustrating, and I have 8 years professional experience as a PHP dev. Just one opinion. Cake PHP is my favorite. However, why do you need to chose a framework to hire a programmer? Seems like it'd be better to look for people who have great experience and professional quality, and ask THEM what framework if any they prefer to use?
  15. //Assuming $end and $start are timestamps. $seconds = $end-$start; $minutes = $seconds/60; while($minutes%15!=0){ $minutes++; }
  16. Uhm, please don't give advice when you literally have no idea what you're talking about. What you're describing sounds like a setup from a specific hosting company. OP is using XAMPP for localhost development.
  17. That's getting you the number of rows, if your query is what you posted. Don't rush, read your code line by line and explain what it does in English.
  18. Computers do exactly what you tell them to. Read your code and think about what you're telling it to do. Hint: you never tell it to get your rows.
  19. 1. Don't nest mysql_* functions like that. It prevents you checking for errors. 2. The limit clause should be LIMIT offset, rowcount. You can only select 6 rows with your current logic. So if you want 15, change it to 15. Otherwise it looks fine at a glance. You need to explain WHAT DOES NOT WORK if you want help.
  20. This forum is for help with code you've written. You need to make an attempt at the code to paginate your results, or explain what exactly you are stuck on. There are plenty of good tutorials on pagination.
  21. There is nothing in your code that attempts to either limit the number of rows displayed, or change that limit to paginate.
  22. http://php.net/manual/en/function.fopen.php Read the descriptions. It explains the differences.
  23. Psycho I think eXeTrix was responding to the OP saying "i guess by default sql adds datetime as unique?".
  24. = is assignment. == is comparison. $selected = "josh" will ALWAYS be true. As you've discovered.
×
×
  • 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.