Question: There is no vendor folder in laravel project. I download the laravel using composer create-project laravel/laravel. What problem?

Answer: 
Your `SELECT` statement is neither needed nor stored.
This can all be done by using a `WHERE` clause within the `UPDATE` statement.

I have written this based on SQL Server syntax and have parameterized the query to avoid SQL Injection. With neither your C# code nor db schema I went with a generic Sql Connection & Command typing; so you most likely will have to adjust this for your circumstances.

Another thing you are going to need is to identify which row is to be updated, I have generic'd this as well with the `UserID` paramaeter.

```
int rowsAffected;
string connString = "";
int Money = (int)customPayTextBox.Text;

using (SqlConnection conn = new SqlConnection(connString)) {
    conn.Open();
    using (SqlCommand cmd = new SqlCommand()) {
        cmd.Connection = conn;
        cmd.CommandText = "UPDATE [User] SET Money = Money - 100 WHERE (IsActive = '1') AND (UserID = @UserID) AND (Money >= @Money);";
        cmd.CommandType = CommandType.Text;
        cmd.Parameters.AddWithValue("@Money", Money);
        cmd.Parameters.AddWithValue("@UserID", UserID);

        rowsAffected = cmd.ExecuteNonQuery();
    }
    conn.Close();
}

if (rowsAffected == 0) { /* user not found OR not enough funds */ }
else { /* at least 1 row was updated */ }

```
You have a few problems here. First,

```
SELECT Money FROM [User] >= '"+ customPayTextBox.Text+"'

```

the `SELECT Money FROM [User]` may return more than one row.

Secondly,

```
'"+ customPayTextBox.Text+"'

```

You shouldn't build a query with unverified user input like that; for one thing, you don't know if `customPayTextBox.Text` actually has a valid integer in it. For another thing, it's a risk for a [SQL Injection Attack](https://en.wikipedia.org/wiki/SQL_injection).

Third,

```
UPDATE [User]
SET Money = Money - 100

```

will just subtract 100 from *every row* in the database (at least in SQL Server, I haven't tested on MySQL). I'm not sure if that's what you're trying to do here.

Finally, the first query:

```
SELECT Money
FROM [User]
WHERE Isactive ='1'

```

won't actually do anything useful here - you neither store nor use the result.

Also, I strongly recommend formatting your code well; it makes it a lot easier to read and understand (and, therefore, a lot easier to debug, maintain, and proofread for potential issues).

**Edit:** Here's an example query for the following table structure:

```
--------------------
| UserID | [Money] |
--------------------
| 1      | 0       |
| 2      | 100     |
| 3      | 200     |
--------------------

```

The following code (using SQL Server syntax):

```
IF ((select [Money] FROM MyTestTable WHERE ID = 1) >= 100)
    PRINT 'Yes' -- Substitute whatever action you want here
ELSE -- Include this if you want to take some action if they don't have enough money
    PRINT 'No' -- Again, substitute whatever action you want here

```

will print `Yes` if user 1 has at least $100 and `No` if they have less than $100.

You can also do something like this:

```
SELECT CASE WHEN ((select top 1 [Money] FROM MyTestTable WHERE ID = 1) >= 100) then 1 else 0 END

```

to just return true/false (it'll be `true`/`false` in MySQL I think).