Skip to content
Advertisement

Tag: php

Why does the user input not append to my SQL database?

I’m developing a login/register form for my client. Right now I am working on the registration part of the form however I seem to have encountered an issue. I am trying to append the user’s input to a database if it does not currently exist. I’m developing this functionality using PHP version 7. However, the code does not seem to

Multiple JOINs to the same subquery expression

I’ve recently been teaching myself SQL, and have been working on a toy project to do so. Here is a sample schema: As part of this project, I have a query that gets a list of users, with information populated relative to the currently authenticated user. A simplified version of the query looks like this: Then, at some endpoints, I

Multiple form submit in Laravel

Good day everyone, I have a form with multiple inputs in it and I want to pass it onto the database on submit. Here’s what my blade.php looks like: on code: Here’s my attempt to find a solution: on my controller: I’m having the following errors: ErrorException Array to string conversion and when adding an image call to a member

Laravel Dynamic DB Relation

I didn’t find any solution so i am asking it here.. The id of Team is related with teams in Match ,for this the solution is easy.. but The Problem is that one Match can have 3/4+ no of teams So i have to make it dynamic … Answer As Per @maki10 The working Solution Is

Laravel sql table error when i try to upload

This is the error i get SQLSTATE[HY000]: General error: 1 table posts has no column named caption (SQL: insert into “posts” (“caption”, “image”, “user_id”, “updated_at”, “created_at”) values (Caption, Why is that post table code blade.php code and i have my PostsController.php as Why is the error coming up? Answer As you are trying to store data into the post table

How to prevent including database config.php from another client?

We have this config.php file: And this structure The index file is accessable via www.example.com/index.php, but the config.php file too (via www.example.com/config.php). Can others just include www.example.com/config.php in there php files and execute code with my $conn? How to prevent this? Answer It’s true that if you leave files in the web root, the web server will execute them when

Using multiple queries (only one is working)

i would like to allow multiple users to login according to their userID and forward each user to his page. However only the last if condition works. Answer You only need to retrieve the User_type_id from the database and then decide on that which page to go to… Although a couple of major points – you should be using prepared

Advertisement