Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. Think of the function as the pitcher and the call as the catcher. If the catcher doesn't have a glove he can't catch it. See my previous example please. Or not.....
  2. When you call a function that does a "return $value", you have to have something in which to return the value, no? $result = password_strength($confirmed_password); Then process the value of $result afterwards.
  3. It's simply a poorly designed piece of code. You've got 20 lines of code that people are looking at and advising you to change simply because it's not readable. For something that is simply simple, you've made it difficult to understand. Why use a Boolean value, which is intended to have TWO values when you have a condition that could have THREE answers? Why make it so complicated when you could simply return SESSION,COOKIE or NONE as your answer? Even you can't figure out this logic to determine what is wrong with the code. As for your current problem, you are asking it to display a variable ($_SESSION['user']) that doesn't exist. Simple as that. Your own code has determined that to be true, but your use of that code is making you try and display it anyway. Try to write code that is readable and understandable by another person completely unfamiliar with the workings of it. If you are ever going to write "robust code" for a bigger project someday, where others may have to work on it after you, you will have to ensure that it can be understood. Good luck!
  4. objnoob: You pick on my post when I was only expressing my agreement with the original sentiment expressed by the guru mac_gyver??? My post explicitly referenced multiple occurrences of this action, not just this particular individual. Additionally, I don't know what you are referring to with: "A better understanding of OOP and the PDO class." - it is not anything I posted and was in no way the target of my post. Frankly, I think you should lighten up and be sure you are flaming the right poster
  5. You process the results set with a while loop as in : while ( $row = $stmt->fetch(PDO::FETCH_ASSOC) ) { do your thing } Also - you have taken advantage of PDO's prepared queries but you are not doing the primary thing behind them: substitute parmaters. Change the where clause to : WHERE valid_users.id=:id "; and the Execute statement to: $stmt->execute(array('id'=>$myid)); This is the whole reason to use a prepared query.
  6. In addition - one cannot use $1,$2, etc as variable names.
  7. At Last! Somebody has come forth and said what I was thinking every time some 'noob' (and others) posted their own idea of how to utilize the PDO interface. Classes, definitions & functions all written to simply run a couple of php functions to get some data. What a colossal waste of energy.
  8. Sorry - your code is just difficult to follow.
  9. Your query ONLY selects one column. Therefore, that is the ONLY column you will retrieve from your db. Seems like you need to change your query
  10. You are not showing enough code to validate what you want us to examine. You don't check the results of the bind-param call. How about giving us enough info to help you out?
  11. What do you define as a "php condition"? I am unfamiliar with that term
  12. You can also write $number1 = $number2 = $number3 = $number4; But if you are doing this - why do you even HAVE 4 variables? Sloppy code work?
  13. I would think that making your query more specific would lessen the load on your database. Why query all the records when you only want a subset?
  14. just realized you had an 'elseif' there. In that case go back to && instead of || (as I suggested) but put a ! in front of a set of parens wrapping all your tests. elseif (!(test && test && test &&test)) { echo error }
  15. Uh...... try using OR instead of AND and then look for the negative of the tests ( ! )????
  16. I sure hope not. It's called spam.
  17. That's an insert query - but not a retrieval. Unless your question concerned data not getting on to the table. I thought you were having difficulties retrieving 'all' your data, so this would not be it.
  18. The query would be most helpful - if we can help at all.
  19. Sounds to me like you are NOT handling this project wisely. With the possibility for "thousands of rows here daily" having any significant number of errors, that you don't want these things to be processed, but rather rejected at input. You really should step back and think about what you can do to help validate the input while the user is in the act of doing it so as to prevent as many 'rejections' as possible. Do you really want to be reviewing dozens(?) of errors every day? PS - this is the first time I've heard of your approach to error handling in 30+ years of design and development. Very strange.
  20. Since you haven't given us a peek at some actual CODE, perhaps you can tell us which of the fields you place in your table are missing? Then we might be able to guess at it.
  21. What do you mean by a processing error? Do you mean you can't add the data to the table? Perhaps you should solve the problem rather than shuffling the data somewhere else. Check for valid data entry before attempting to post it to the db.
  22. The way it works in forums - you write your code. We help if you have a bug or problem with it.
  23. Looking at your plan it seems very workable. I would revise the two tables to be sure that you can match like room titles/ids since currently they seem to be different. Process then would be to seek records from both tables that match the standard room type desired and any 'special' room rate records that match that type and the specified date range. Pretty straight forward to me.
×
×
  • 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.