I am trying to send a message to a socket and read the response back in either PHP or Python. I have tried Telneting into the IP/Port and manually sending a command/receiving a response to verify the server is operating as expected. I have also tried connecting using nc (netcat) and that also works fine. In b…
Tag: php
Laravel migration: “Foreign key constraint is incorrectly formed”)
My migration fails when I try to execute php artisan migrate or php artisan migrate:refresh with this error: Code Users Table (migrated successfully) Address Table (fails with error) Answer One of the reasons to work with a framework such as Laravel is syntactic sugar. By following their conventions, you writ…
Problems with cUrl giving constant http code 0 => error 6
Hello and foremost thank you for your minute! I am having troubles with cURL. This seems to work perfect on my localhost but on my server it just doesn’t send off requests. Each response of the error code is “Could not resolve host: ….the url im searching…” I haven’t found …
PHP script taking too long. Need someone to take a look at my code to optimize it
I have a script that fetches data from a remote restful API and saves it to the local database. I get the reponse from the server in chunks of 2000 so i have to check if a nextRecordsUrl exists so i …
add specific text to a customm fields with php (wordpress)
I want to add text “Genre:” to the beginning of this custom field the reason that i dont simply add something like this is that i dont want to this text be shown when there isnt this field for a post Answer You can check if the field exists and then display your HTML element.
Why is my $items doesn’t hold a group of $item? Laravel 8 Ecommerce
I’m from the same post here but I’ve found the root problem why is my quantity won’t increment but I don’t know how to solve this. The problem is at my isset function (in Cart.php), because I tried to echo something there and just realized the function isn’t running. This is the …
How to create table with Foreign Keys in Laravel?
I have a users table and a roles table Now I want to create a user_role table which have two foreign keys But I’m getting an error: IlluminateDatabaseQueryException SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your Mar…
Livewire wire:model not working with nested components
I’m creating a page using livewire to list users from DB and be able to update them.. I have a Users parent component and (User)s child components users.blade.php: user.blade.php Users.php User.php This is what i’m getting in the browser Any idea why this is happening ? Answer I found the issue, i…
RecyclerView only shown on minimized [closed]
I use retrofit to get data from PHP(localhost) as JSON and display it with recycler view. My problem is my data never show whenever I go fullscreen(Image 1) and goes normal whenever I minimized the …
Calling text from a different php file
I’m looking to find a way to make a config.php file to setup the website easier. See below; config.php – index.php – contact.php (same setup, just a different page) – I’m fairly new to PHP so I’m not sure if echo is the best way to do it or not. Thanks! Answer Ye so just cr…