Jump to content


  • Content count

  • Joined

  • Last visited

  • Days Won


benanamen last won the day on March 23

benanamen had the most liked content!

Community Reputation

86 Excellent

About benanamen

  • Rank
    Master Coder

Contact Methods

  • Website URL
  • Yahoo

Profile Information

  • Gender
    Not Telling
  • Interests
    Email me at phpfreaks@galaxyinternet.us

Recent Profile Visitors

2,657 profile views
  1. benanamen

    SQL execute error

    Yeah, I was thinking the same exact thing. OP, what ever you are doing is wrong. How about telling us what the real problem is you are trying to solve. We will show you the correct way to solve the problem, then you can attempt to translate it to the bass ackwards requirements imposed on you.
  2. Pretty sure I know who you are talking about. In this case, it is the same guy. Same username, same profile pic, same subject matter.
  3. @mac_gyver, OP has been told over and over and over again what he needs to do and doesn't listen to anyone. He came to this forum after finally being ignored on another one. I even warned him in the introductions when he showed up here here about it.
  4. benanamen

    php optimization; 1 or 2 if's

    Doing some quick tests, the multiple nested control structures take up to nine times longer to execute that a single control structure. It only makes sense that a single one is going to be faster than a double nested one. The clear winner if ($MOSTLY_FALSE && $ALWAYS_CHANGING) { // do this exceptional thing }
  5. benanamen

    php optimization; 1 or 2 if's

    Verbose means more words than necessary, redundant is saying the same exact thing more than once. RTFM means Read the Free Manual. Basically it is like your code stutters and repeats the exact same thing. Example: if true = true And true = true { //do something } Or if true = true { if true = true { //do something } }
  6. benanamen

    php optimization; 1 or 2 if's

    You fail to understand the if control structure. if is a Boolean check, therefore adding == true or == 1 is redundant. The if already determines true/false. There is no need to nest the statements. What you are asking in code is if A AND B is true, do whatever. KISS <?php if ($a && $b) echo "a and b are true"; ?> Feel free to RTFM. It's Free. http://php.net/manual/en/control-structures.if.php 😀
  7. benanamen

    php mysql adding zero to emtpy row?

    When you find yourself doing sequential numbering of fields that is a good sign you are doing something wrong. Your form names should be the same name but make them arrays, then you would loop through the array when you submit the form. You can see a complete example on my site at https://galaxyinternet.us/php-insert-form-array/
  8. benanamen

    PHP Help - HTML Form .POST

    Look at your error log and see what the error says. You only need to specify the POST method in the form. It will automatically submit to the same page. Suedo Code <?php if (Server Request Method == POST){ //Process Form } ?> HTML HERE.. <form method = post> </form>
  9. benanamen

    PHP Help - HTML Form .POST

    Welcome to the forum First off, just saying your getting an error doesn't help anyone. We do not have a crystal ball and cannot see your screen. You need to post the exact errors you get. Blindly using user supplied data makes you ripe for an injection attack. Do not create variables for nothing. With checkboxes, you need to use isset. If the box is not checked, nothing will be sent with the form. It would be better practice to have your form and the processing code in the same page. Php at the top, HTML at the bottom.
  10. Its because you have that line outside the logic so it will run on every loop.
  11. benanamen

    mysqli rename table column

    OP, Why are you writing Php code for what should be a onetime DB alteration? The command line, Phpmyadmin or some other GUI that works directly on the DB makes much more sense.
  12. benanamen

    Help needed with database search and update

    When you see that you are duplicating code, in this case, the header and database connection code, you want to separate it to it's own file and include it in the files that need it. Next thing, you are dumping a bunch of JS files right smack in the middle of a table. You need to learn about "Separation of Concerns". You are also dumping the DB connection code the same way. Separate it to its on file and include it in the files that need it and not in the middle of a table. Do not output internal system errors to the user. That info is only good to hackers. You need to check the server request method, not the name of a field or button. You don't need sixteen echo's to do the job of one. Even better, you should use the Php output tag and not have your HTML mixed in with Php. There is no need to manually close the connection. Php will do it automatically. Clean up the code and you will be much less likely to have simple problems. I would also recommend you use PDO. Here is a tutorial to get you going. https://phpdelusions.net/pdo
  13. benanamen

    Help needed with database search and update

    There are many many problems with the Code posted. Directly related to what you're asking is you are using one form with no Method type for multiple rows. Calling a POST get is going to be confusing to people who know how to code. Short on time so I will have to answer more in detail later if someone else has not already provided more info on the code.
  14. benanamen

    countdown timer needed

    My last go at this thread. Java is not the same thing as JavaScript which is what you are actually referring to. Using the wrong terminology could make it difficult for you to get correct responses.
  15. benanamen

    countdown timer needed

    Sums it up pretty well. Being familiar with the OP from another forum I gave him a heads up when he showed up here. OP, I highly recommend you put some effort into learning on your own and not posting every time a question pops in your head. We are more than happy to help when you get stuck, meaning you have already made attempts on your own to find the answers you need. As you saw from the other forum, people will start ignoring you if you wear out your welcome.

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.