451
Developer's Corner / Re: Sql Syntax Error
« Last post by Shades on April 12, 2019, 11:04 AM »15 years or so ago I took a look at working with PHP. Bought books (with example CD included) and such for that journey. Perhaps some 4 or 5 months in, I started to dislike it profoundly and never looked back. Sold all I had about PHP and never did anything real with it anymore. I am sure code quality has improved a lot from the mess it was back then, but meh. You have already more experience with current PHP syntax than I do, so don't expect examples from my end.
So, invest in a digital or analog book about the subject and brush up your knowledge about how to do things right, before you have coded a semi-functional something that is rife with bad coding practices and/or security flaws. Or check videos if that is more of your thing than books. Free online courses from respectable universities are available to you as well. The main point here is to educate yourself first, before going down the rabbit hole (the 'failing to prepare == preparing to fail' thing).
Bumping your head on the material is (and must be) part of the learning process. Using pre-chewed examples won't make you understand the material better. And if you use those examples verbatim in your code, be prepared for lots of misery later on in your project. And by then fixing the technical debt will be a major headache. And you'll likely start over from scratch, doing it right. Except you have lost about two to three times the amount of time in the best of cases.
The placeholder "?" was used because it was mentioned in your example. ? is one of a set of special characters, which need more "treatment" in queries (encapsulation and/or escape characters). And you will have "fun" with applying the type of encapsulation that works well on one operating system and not the other. Code that works on a Windows development box is not guaranteed to work on a Linux production box. Or even a Windows production box (if the development box differs too much from the production box).
In any case, that kind of experience you must learn first hand, else it haunts you your whole career or even a lifetime.
Another tip:
If Google doesn't give you examples of a pagination script with search feature....
...why not search for examples of pagination scripts, other examples of search scripts and combine these yourself on your development box? Losing lots of time looking for one special item or dividing the search into parts and perhaps lose a lot of time making the parts whole. Guess which approach will get you more educated and improve your skills...
DC member Wraith is right about you searching for examples or advice on sites like StackOverflow, SuperUser or even W3Schools. Such sites were created with people like yourself (in the beginnings of their programming career) in mind. To give such persons a helping hand, I mean.
So, invest in a digital or analog book about the subject and brush up your knowledge about how to do things right, before you have coded a semi-functional something that is rife with bad coding practices and/or security flaws. Or check videos if that is more of your thing than books. Free online courses from respectable universities are available to you as well. The main point here is to educate yourself first, before going down the rabbit hole (the 'failing to prepare == preparing to fail' thing).
Bumping your head on the material is (and must be) part of the learning process. Using pre-chewed examples won't make you understand the material better. And if you use those examples verbatim in your code, be prepared for lots of misery later on in your project. And by then fixing the technical debt will be a major headache. And you'll likely start over from scratch, doing it right. Except you have lost about two to three times the amount of time in the best of cases.
The placeholder "?" was used because it was mentioned in your example. ? is one of a set of special characters, which need more "treatment" in queries (encapsulation and/or escape characters). And you will have "fun" with applying the type of encapsulation that works well on one operating system and not the other. Code that works on a Windows development box is not guaranteed to work on a Linux production box. Or even a Windows production box (if the development box differs too much from the production box).
In any case, that kind of experience you must learn first hand, else it haunts you your whole career or even a lifetime.
Another tip:
If Google doesn't give you examples of a pagination script with search feature....
...why not search for examples of pagination scripts, other examples of search scripts and combine these yourself on your development box? Losing lots of time looking for one special item or dividing the search into parts and perhaps lose a lot of time making the parts whole. Guess which approach will get you more educated and improve your skills...
DC member Wraith is right about you searching for examples or advice on sites like StackOverflow, SuperUser or even W3Schools. Such sites were created with people like yourself (in the beginnings of their programming career) in mind. To give such persons a helping hand, I mean.

Recent Posts