Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


gizmola last won the day on July 2

gizmola had the most liked content!


About gizmola

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
    Los Angeles, CA USA

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

gizmola's Achievements

Prolific Member

Prolific Member (5/5)




Community Answers

  1. It's a great question. I have to think that it was extra work to create the associative array version, so it never really made a lot of sense why having two versions of the same data returned in the same array, would be the default.
  2. Barand as usual offers an expert solution. Looking at your original schema model, please don't include a prefix for the table name like q_column etc. Also don't use Enums. They violate a basic tenet of relational database theory (any field/attribute in a row should contain a single value). If you really want category and type, those are foreign keys to separate tables. In cases where the PK is a char, I will tend to name that column "code", just to be clear that it's not a sequential key. For example, I often have fairly static type tables, like "status" where the allowable values are things like "new", "active", "deleted", and I'll use a char(1) and 'N', 'A', 'D' for those values in a status table with "code" and "description" as the only fields. I personally have done what Barand did (using table_id) many times, primarily to make it easier for the design tool(s) I typically used, but most ORM's like it if you just name your table pk "id". When you add a foreign key, then make that "tablename_id". A lot of ORM's will pick up on naming conventions for keys, so it makes things easier, as the ones I've used will default to the assumption that the "id" field is the primary key for the table. Not a huge fan of these types of columns, but created_at, and updated_at are good for timestamps like your "q_added".
  3. Just a quick comment on this. A user does not need to see a button to call Ajax in order to exploit the Ajax. All they need is to know that it is there, and they can use whatever technique or tool that they want to, to post to the Ajax url. Anything that needs to be secured should have a separate permissions check. A simple common solution would be to check something stored in the session that indicates someone is an admin, or some other user level. Then your Ajax code should check that and only execute the actual deletion code when their status is affirmed.
  4. I just use eclipse with PDT. I'm not sure what you are using. For PHP development I really would endorse the other options I mentioned.
  5. This is the mod_rewrite rules of a typical current wordpress: RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] What this shows, is that Wordpress implements a front controller. I don't know exactly what the issue is, because my example was: user's url -> rewritten to And it appears to me that you presented: rewritten to -> user's url Requinix has tried to steer you towards this, so I'm going back somewhat to the start, and suggesting you add this to the bottom of your rules: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/ page.php?slug=$1 [L,QSA]
  6. Did you get this from chatgpt? This literally says absolutely nothing, as it refers to 2 "approaches" neither of which were listed. It's like you cut and paste from something else. I hope your future posts will be of more value than this one.
  7. The eclipse PHP environment (PDT) is built upon the eclipse "Dynamic Languages Toolkit"(DLTK). What the DLTK does is build the internal structure that PDT depends upon to map and index the project files. It utilizes the project source tree, so in general, there is no need to go farther than that, and as php has evolved with the advent of composer, there isn't much need to specify the location of libraries that exist outside of the source tree. In the olden days of PHP when people used PEAR libraries, you would have pear libraries that were put in a shared location, but PEAR is entirely deprecated now that we have composer for component library management. I don't use Eclipse PDT much these days, other than for a specific maintenance project, as I find that PHPStorm or VSCode with the inteliphense plugin are both much better IDE's for PHP development at this point in time.
  8. In the code you provided, it assumes there is a function ConfirmCancelOrder. As requinix stated, if this is your choice, you only need confirm. From a style and usability standpoint, builtin modals like alert and confirm are not used much anymore, because they depend on the browser/os UI kit, and can't be styled to look like the rest of the UI, which looks amateurish. Most people implement a modal dialog window. Most css frameworks come with widgets (css + javascript) that are easy to use. Twitter bootstrap is the grand parent of this idea, and while I don't offer this a recommendation, if you already happen to be using twitter bootstrap, here's a link to documentation for their modal. Most other css frameworks, or javascript ui frameworks, have similar helpers. The general idea is simple and reusable -- your markup will include the div for the modal which starts out hidden, and when needed, you pass some parameters to it for the specific title and message. You can usually build your code in a way that makes it easy to include the partial html and javascript you need for any pages that have html forms where you also want confirmation.
  9. Making a file without an extension work with any sort of serverside language, requires configuration to associate those files with the serverside language. The same sort of association can be made in an editor, but as previously commented, using the rewrite capability in apache mod_rewrite or nginx is the best practice.
  10. It seems like you are fixed on using $matches. People tried a few different ways to tell you that the function returns the number of matches, so this is your original code re-written. $c = preg_match_all('/[0-9]{1,}[-]{1}[0-9]{1,}/', $txt, $matches); $d = preg_match_all('/[A-Za-z]{1,}[-]{1}[A-Za-z]{1,}/', $txt, $matches); echo "c count=$c"; echo "d count=$d"; The reason for this, is that any regex can have groupings (capture groups) that produce partial matches, and all of these are returned in the $matches array. The return value only returns the actual number of full matches, which is clearly what you want.
  11. On the most recent screenshot you provided, what do you see when you click on the "manage" link next to line that shows php version 7.4?
  12. Not that this explains the problem, but if you want a grouping for these 2 products, then group by product.product_id, not product_name. Also, no reason to do this: JOIN products ON (products.product_id = 55 OR products.product_id = 51) You should be joining from the salesdetails row to product. JOIN products ON (products.product_id = salesdetails.salesdetails_product_id)
  13. In addition to what requinix said, consider that private networks are using private "non-routable" IP ranges. Outwards, your router is doing "Network address translation" (NAT) When you want to access a particular computer on a particular port that is inside a private network, there is simply no way to do that, because these IP ranges like 10.x.x.x and 192.168.x.x and 172.31.x.x are reserved for private network use. Core routers will never route packets with those IP addresses. A VPN is giving you a private IP on the private network, and intelligently routing traffic meant to go to your intranet. Production networks use the same ideas. As requinix already explained, there are many good reasons to isolate servers inside a private network, and even subnet the private network to isolate groups of computers from each other. Tunneling allows you to use a gateway server for entry into a private network, just as a vpn server does. And you can then hop to another server, and perhaps others if need be, in order to create a secure tunnel that gets you network access to the server you want. Most system administration is enabled by the use of SSH to connect and tunnel through servers to access other servers, that otherwise would be unreachable.
  14. If you can afford it, PHPStorm is pretty much the professional standard. A lot of people also use visual studio code, in combination with the "Intelephense" plugin. Intelephense provides a good number of features for free, but you can also license it for $20 to unlock the rest of the features, which I would highly recommend.
  15. I looked at the site, opened the menu and tried to navigate to: http://whymyphp.online/galery/fetchit.php which produces a 500 error. This is the same issue we've been looking at, and we keep coming back to the fact that mysqli is not the version that has been linked to the myslqnd driver. This is not by any means a new issue. See this 4 year old SO question. The confusion relates to godaddy and cpanel, and the specific extensions that are enabled through cpanel. At this point, it is pretty much up to the OP to enable the right extensions through cpanel.
  • 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.