Jump to content

benanamen

Members
  • Posts

    2,134
  • Joined

  • Last visited

  • Days Won

    42

Everything posted by benanamen

  1. Your doing something wrong. Code should not be parsing print_r.
  2. Take the quotes off the constant connection parameters in the connect string. It is also standard practice to use all UPPERCASE for constants. $connect = mysqli_connect(serverhost, serveruser, serverpass, $db);
  3. Your query is failing. You are using single quotes so the variables are not being interpolated. You should be using Prepared Statements anyways. NEVER EVER put variables in the query and don't create variables for nothing. There is no need to manually close the connection. Php will do it automatically. I would also recommend you use PDO. Here is a tutorial to get you going. https://phpdelusions.net/pdo
  4. Correct me if I am wrong, but you want to use the value of $id by using a completely different variable named $customerID?
  5. Based on your post on the other forum, you should take the time to learn the basics of Laravel. I would suggest you check out the Laracast video tutorials. The third party app you are trying to modify is using a very old version of Laravel.
  6. OP was already advised about his code on another forum and did not implement any of the advice whatsoever. His response was "Could you please write it to me". OP, we are not a coding on demand service. You apparently didn't even attempt to copy and paste the complete working example from the tutorial you were referred to. If you just want someone to write it for you then post a job offer on any of the forums jobs section.
  7. WHERE `district`= {$_SESSION['g_district']} ");
  8. There is no such thing as a "from" tag.
  9. Can you please provide the default sql so we can run the code.
  10. OP, do you seriously think we can do something with PICTURES of CUTOFF CODE?
  11. That is not the way to handle it. Set a unique constraint on the DB column(s) Attempt the insert and catch the duplicate error if any.
  12. OMG! I could care less about your code dude! I was just trying to help you. Good luck getting assistance with that attitude.
  13. Hi @NotionCommotion, long time no chat. This is all interesting stuff. I was just wondering, are you actually having a problem to where this matters or is this just for learning?
  14. Tell you what, if you can provide a zip of your files I will review it and tell you what is wrong.
  15. In that case, just remove the session start from your include files. You should have no need to check if a session has been started.
  16. I'm sorry, I assumed you wanted to learn how to do things better. My bad.
  17. The better approach is to have a single point of entry to the site/application. Then as mentioned, you set the session once in the main file. Here is a free video series tutorial on Php by the Laravel Laracast guy. Even I, after more than 30 years of programming learned several new things. https://laracasts.com/series/php-for-beginners
  18. Sure you could but you are going to need code gymnastics to cover every possible case. Not really optimum IMO. The "extra data input" is a one time insert and you are done with it. At that point, it is as simple as selecting the column in your query.
  19. Based on the site link I would say what you are looking for is a "short name" for the schools. I would add a column to the DB to hold that data. So you have columns city, school_full_name, school_short_name
  20. That makes no sense at all. If you are displaying the data from the school name column why would it not be what the school is named?
  21. IMO, you are just creating a problem mixing data. It doesn't matter if the school name is the same as the city. A city is a city, a school is a school.
  22. Thanks for letting us know.
  23. Thanks @Psycho. Shows how much I knew about Factorials, lol.
  24. This is a real thing how the brain works. It has to do with how the prefrontal cortex works. I have solved many a problem by not trying to solve the problem and stepping away from it. Without trying, you get that A-ha moment and the answer comes to you.
×
×
  • 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.