I have a FORM with method POST. In the form I have two select drop-down with multiple=’multiple’ enabled in both so that user can make multiple selections. Now I am using MySQL database to store data. …
Laravel: showing selected value in edit form
I added a drop down list in the user registration form in Laravel. Now I want to make a form to edit it but I’m stuck. What I did is I made a drop down list which a new user can register where he/she …
Reload database before some test in phpunit
I’m currently developing unit tests with phpunit, and symfony 5. On a previous job using behat, we were able to reload the database only for the tests having a specific tag. I’d like to do something similar. I know there is the setUp() method and the @before annotation, but they don’t let me…
PHP # Accessing protected or private Variables of class by reference intended or a bug?
Explanation While researching, I created this little code snippet below to get to know php better. The reason why I now create this question is to reach more experienced developers in order to not …
Displaying SQL result in JSON and parse data using Javascript. Seperate text from [{:,}]
Result is Expecting Result Using javascript: Answer As the json code from your comment, you can do something like this:
Laravel store multiple just saves one
I am sending array of data to controller but it only saves 1 row to database, I need to save multiple rows (depend on array length). Code controller Screenshot request data stored data any idea? Answer Move $transit = new Transit; inside the foreach, and end the foreach loop right before returning the respons…
PHP, Image preview with javascript and uploader by PHP
I made PHP script to preview an image before upload it, which is simple and easy to read. the first part is to displays the image then to upload it after pressing Submit button. I have an issue with uploading the image, it doesn’t upload. Answer You have several logical errors in your PHP Code as well a…
PHP Array format with numbers
i have a big trouble with this code, i need format an array to use in different select, i have an array structure same of this: array (size=6) 0 => array (size=9) 0 => string ‘…
Remove read more button for out of stock item
Ive been strugling with removing a “read more” or “beri dalje” button from my website. The website in question is www.fotroviciliji.si . I can locate it and hide it in chrome investigator but not via global css or using php in functions.php. The button has a class name btn border-grey …
How to store multiple values in a row, column or table? What is most efficient?
I have this problem where I want to create a data page where you can see how you’ve progressed in losing weight. I start by collecting their weight, but in order for me to actually do stuff with the data, I need multiple values. For example – Below is a picture of my colums, where vaegtUsers and h…