I have a problem with the following code. index.php crud.class.php The code “works” but it doesnt do it the right way. It does update at the requested id in the correct table, but the values are both the same. The data base contains 2 cols (gerecht and omschrijving) and the values that will be upd…
Tag: php
Insert a CSS file within a PHP class
I have a little problem, which I can’t figure out by myself. I created sort of a “webengine”, which I build out of several classes. The main-class, getting a “theme’s” internals is called “Logic”. This logic-class includes all the files, needed for a website. I …
artisan migration error “Class ‘Doctrine\DBAL\Driver\PDOMySql\Driver’ not found”,
When trying to run a migration I get the error Artisan migration error:Class ‘Doctrine\DBAL\Driver\PDOMySql\Driver’ not found I have read the questions here and also see the notes to add: …
How to print the sql count in a view?
I have this But I don’t know how to print the result in a view ? Answer The select method will always return an array of results. To print the count: To print the result in a view you have to pass a variable: Then print the result in your view: To get more details about the database with Laravel,
PHP Header Redirect with parameter
So I want to use a basic header redirect to bring a variable from one page to another. This seems really basic, but everywhere I look people are asking about more complex situations and it makes it harder to grasp. Basically, I have a variable $user = “root” and I simply want to pass this to anoth…
CodeIgniter Multiple File Upload not working
I am trying upload multiple file in a folder but it’s giving the error “You did not select a file to upload.” A PHP Error was encountered Severity: Warning Message: is_uploaded_file() expects parameter 1 to be string, array given Filename: libraries/Upload.php Line Number: 412 Backtrace: Fil…
Keep query string for external urls
A user can be sent to the main website by some referral id, using a query string: And when they click on a link to a login area, this query string must go with that external link: I am working with wordpress, so I cannot append ?ref=<?php echo $_GET[‘ref’]?> to that link. I have already chan…
Double HTTP Authorization
I am currently working on a project that I’ve decided to go with basic HTTP authorization at the admin area for simplicity, however the company I’m working for already has HTTP authorization on their staging server and I was wondering if it is possible to have double HTTP authorization? Looking at…
Ionic PHP connection in Android APK
For a school project we are working on an app with the Ionic framework that needs to connect to an external PHP file. When the user submits a form, the input has to go to the PHP file, get dropped in a database, and also return a value in the app. We’ve got everything working locally, as well as in
Serialize/deserialize nested objects to JSON with type in PHP
I have classes that extends an abstract class. I need to create instances of these classes through a string – preferably JSON. Many of the objects are nested, and many properties are private. I need a way to: Create a JSON string of the complete object (with private properties and nested objects –…