I have a truck table, a package table, and a postman table. Truck table and package table has a one to many relationship. Truck table and postman table has a one to one relationship. Now I can delete truck table just fine, but I got integrity constraints violation error inside the truck table when I try to up…
For loop conversion problem from python to PHP
I try to convert the following Python function: into a PHP function: And when I test it: I get the error: for the line And I don’t know how to solve it, do you have any ideas? Answer Python’s range(n) returns an array from 0 to n-1 while PHP’s range($n, $m) returns an array from $n to $m, so…
Make A Dynamical Model With Join CodeIgniter
I asked this question yesterday but it got deleted because admins said it got similar question with other post but when I check it there it doesn’t have the same problem with me, so ill ask again and hope that admin can understand. I have this model in CodeIgniter: It has a parameter that I can use dyna…
How can I upload .mp4, .mp3 and .doc Files along other FormData with AJAX?
Good day guys. I’ve been uploading files (docs and images) from AJAX. Although, I’ve searched this site for uploading videos from AJAX, I have not seen exactly what I want. I only saw, uploading a …
Add extra cost to flat rate shipping each 2 items from specific category in WooCommerce
Based on Add an additional cost to flat rate shipping each 3 items in Woocommerce answer code, I have made some changes to add an additional cost to flat are shipping method each 2 items (instead of …
Target class [DatabaseSeedersUsersTableSeeder] does not exist
I am getting the error “Target class [DatabaseSeedersUsersTableSeeder] does not exist” and I cannot figure out why. I have already tried solutions posted to similar issues and none of them worked for me. Here is my composer.json autoload/classmap settings UsersTableSeeder class DatabaseSeeder clas…
PHP/Ratchet websocket – issues with while loop
I have a very simple websocket using PHP and Ratchet libraray. When a user opens a specific page it sends the users id to my socket and it should update the status for that user (at the moment I’m …
Uploading PDFs to a directory PHP
I’m uploading PDFs to a directory and my script works fine for one directory but I’m having troubles coming up with a way to write the script efficiently when I have more then one directory to upload PDFs on a page. I know of a few ways I can do it, like write another function like below but there…
MySQL SELECT in order of array values
Can anyone help me with a Query query? I have an array of IDs $IDvalues = array(“128”, “159”, “7”, “81”, “82”, “83”); And need to retrieve data from another table in the order of the array. At the moment, I have this query: But it’s…
Can i carry PHP variables over into an HTML or Javascript file
I’m new to PHP and am trying to create an Age Validation form that will limit access to specific content on a site if a user is under a certain age. This is the HTML form (index.html): <!…