Jump to content

benanamen

Members
  • Content Count

    1,775
  • Joined

  • Last visited

  • Days Won

    32

Everything posted by benanamen

  1. benanamen

    PHP Not connecting to SQL Server

    mssql_connect was removed from Php http://php.net/manual/en/function.mssql-connect.php PDO is how you will want to do it. http://php.net/manual/en/book.pdo.php
  2. benanamen

    Recursive Conditional Copy and Rename

    What are you doing in dev that is not going to be pushed to production? If you are serious about development you shouldn't be in a position where the web host is making changes to your server. A VPS is super super cheap these days and is the equivalent of a dedicated server as far as access and what runs on it. YOU have full control of the server. Of course that means you will need to have or get some server admin skills. There is also no reason you couldn't exactly mirror whatever production setup you have in dev between Vagrant, Containers such as Docker or Virtual Machines. You should also be using version control like Git if you are not already. That will allow you to have dev branches and not affect the master codebase until you are ready to merge the changes.
  3. benanamen

    Recursive Conditional Copy and Rename

    You probably should go into it. Experience says whatever you are doing, you are doing it the wrong way. You are asking how to solve your attempted solution which I would pretty much guarantee is not the right approach. If you tell us what the real problem is we can properly advise you.
  4. benanamen

    Adding

    `
  5. benanamen

    Submit large form created with select statement

    Start by posting your form. You are heading off in the wrong direction.
  6. benanamen

    Submit large form created with select statement

    I will give you a clue. When you submit a form you get an array. The array has keys and values. You can loop over an array and do something with the keys and values.
  7. benanamen

    Doctrine, Composer, and namespace

    @NotionCommotion, thanks, that explanation is exactly what I was getting at. It helps put everything in perspective. Glad you figured out the problem.
  8. benanamen

    Doctrine, Composer, and namespace

    I cant teach you anything correctly if I don't know you are really doing. Sure I get you are asking "how to implement Class Table Inheritance using Doctrine ", but from my position, I have no idea if that is actually the correct solution to your problem. By forcing me to focus on your attempt instead of the problem you are locking yourself out of any other potential or better solutions. If you just plain ol wanted to learn Class Table Inheritance using Doctrine, that is one thing, but it comes across as though you have deemed this to be the solution to a problem at hand. I know your not asking me to build you something. I was trying to get across an easy way for me to understand what I was asking of you. The very nature of all your posts being outside the realm of what many of us with numerous years experience have ever seen makes it even more important to know what the actual project is. Honestly, I have often wondered if PHP is even the right language for whatever it is you are doing. Since I, and others have no clue to what it is, who's to say.
  9. benanamen

    Doctrine, Composer, and namespace

    Seems to be a DB design problem but since I still have no idea what is going on so I cant really say. You keep replying about HOW you are trying to solve a problem. I have no idea what this is really about. Best I can tell it has something to do with cars, trains, rockets and airplanes. What is the overall project at hand? Forget that you know any programming at all and you are telling me about something you want me to build for you.
  10. benanamen

    PHP Include with Open ELSE

    If you include a footer before a header file, the footer is going to show up in source on top of the header and vice versa which clearly shows that an include is "inserted" where the include is called. Of course, the OP has some conditional thing going on, but the cut and paste I suggested will show how the code is not "syntactically valid " as you already mentioned. As for your example using a conditional, the first one is saying "if true is false, then include the file". Since true is not false, it doesn't include it. In the second example, you are not using curly braces, so only one statement is evaluated in the if, which is of the same effect as the first one, if true is false, then echo the first line". True is not false, so it doesn't echo the first line. Seems we might not be on the same page. Kindly explain what you wanted me to see about the example. FYI: You did get me to learn up on something. Since I always use curly braces I didn't know without them only one statement is evaluated.
  11. benanamen

    PHP Include with Open ELSE

    Perhaps I am misunderstanding you because you are referencing the OP's post. Include does in fact "insert" the code at the point you include the file. An included file may not have anything that "runs". It could just be some HTML. As the manual says, include "evaluates the specified file". It is the same as though you cut and pasted whatever is in the include into the place the include is called. So OP, to see what you are actually doing, cut and past the contents of the include as a replacement to the include line and you will see the code as PHP is seeing it.
  12. benanamen

    Doctrine, Composer, and namespace

    Not a knock on you @NotionCommotion, but I agree with @ginerjm. Everything you post about is outside the realm of anything I have ever encountered in 30 years of being in the industry. To this day, I still have no clue what you are up to. I would really be interested in what you are doing, you know, the Real problem, as I often say.
  13. benanamen

    PHP in CSS with SQL and Sessions

    Your post makes no sense to me. CSS has absolutely nothing to do with PHP, SQL or Sessions. "Progress into the css file"??? Makes no sense at all. How about telling us what the REAL problem is instead of asking about your attempted solution to the real problem.
  14. benanamen

    PHP picture name from sql not loading

    Ok, technically speaking yeah. What I meant was the OP broke free of the the single quotes with concatenation "escaping" from being within the single quotes.
  15. benanamen

    PHP picture name from sql not loading

    Right here @Barand echo '<img src="img/' . $row_product_image['name'] . '" class="w-100" />';
  16. benanamen

    PHP picture name from sql not loading

    This is true, except OP escaped the single-quoted strings so what he posted does in fact work.
  17. benanamen

    Undefined offset & error in your SQL syntax

    stripslashes on DB input? Are you really expecting your users to put slashes in the submitted data? That was typically a 90's DB output function back in the days when magic quotes was used. If you are learning from some tutorial now would be time to find a new one. I would highly suggest you start learning PDO. Here is a tutorial to get you going. https://phpdelusions.net/pdo
  18. benanamen

    issue with array_unique

    @ZackTim, post an SQL dump of your DB schema with a few sample records so we can see what your working with.
  19. benanamen

    Problem with quotation marks

    If you simply switched the double and single quotes around you wouldn't have to go through all the error prone escaping gymnastics. Open and close the echo with double quotes, then single quotes in all your elements.
  20. benanamen

    How to make simple if repeat in looping?

    Great, this is exactly what I was referring to as the real problem. Now we can decide what the correct approach should be, whether it is your approach or something else. I was not angry. We just need to know what is really going on to provide the best answers for you.
  21. benanamen

    How to make simple if repeat in looping?

    You don't seem to understand my question. You are asking how to solve your Attempted Solution to the Real problem. I want to know what the REAL problem is, not your approach to solving it. WHY are you doing this? Therein lies the REAL problem.
  22. benanamen

    How to make simple if repeat in looping?

    What is the actual (real) problem you are trying to solve with this code?
  23. benanamen

    Conversion of text data from $variables issue

    Instead of asking about your attempted solution to your problem, tell us what the real problem is you are trying to solve. You said you want to " use data from a MySQL query ". That sounds like that would be the real problem. Post the code you have tried to retrieve data from MySQL.
  24. benanamen

    Is there a proper way to set this up?

    The better method is to have a single point of entry, eliminating duplicate code and not using the XSS vulnerable $_SERVER['PHP_SELF']
  25. Unless this is just to learn the basics of file reading and writing do not store your data in a text file. At minimum use SQLite.
×

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.