Data store in database?

|
Carlos 2022-06-24 07:14:25
in the database the salary_value column is double
Carlos 2022-06-24 07:15:13
SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: salary_value
Carlos 2022-06-24 07:15:42
I can’t save the data in the database
Carlos 2022-06-24 07:16:14
salary_value is: 6433.57
Rahul Kahar 2022-06-24 07:24:57
Carlos 2022-06-24 07:16:14
salary_value is: 6433.57

Pass integer value and check data insert or not

Rahul Kahar 2022-06-24 07:25:11
Like 6433
Carlos 2022-06-24 07:28:40
input view
Carlos 2022-06-24 07:28:51
<td class=”form-group col-md-1″ style=”text-align: right”> <input type=”text” class=”valor form-control_total input-sm” name=”salary_value” style=”text-align: right; vertical-align: middle; background-color: #acacac;” id=”salary_value” value=”{{ $salary_value }}” readonly></td>
Rahul Kahar 2022-06-24 07:30:13
Rahul Kahar 2022-06-24 07:25:11
Like 6433

Data store in database?

Carlos 2022-06-24 07:31:58
Yes.
Carlos 2022-06-24 07:32:09
Postgres
Rahul Kahar 2022-06-24 07:32:19
Ok
Rahul Kahar 2022-06-24 07:32:54
So check in database that double type column format
Rahul Kahar 2022-06-24 07:33:34
You need to set double format properly
Rahul Kahar 2022-06-24 07:34:09
Rahul Kahar 2022-06-24 07:33:34
You need to set double format properly

To accept float value

agzpresh 2022-06-24 07:34:15
Okay
Carlos 2022-06-24 07:38:07
the strange thing that in the database in the salary_value column is double
lailiseptiandi 2022-06-24 07:40:38
try to debug in controller dd($request->all())
Carlos 2022-06-24 07:47:13
lailiseptiandi 2022-06-24 07:40:38
try to debug in controller dd($request->all())

continues with error

Carlos 2022-06-24 07:47:39
Carlos 2022-06-24 07:15:13
SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: salary_value

that

Amit Sharma 2022-06-24 07:48:10
laravel_discuss-126607.jpg
any one pls suggest me i have a numbers or records fetching from database
Amit Sharma 2022-06-24 07:49:10
and i want to print last number of $i that in this case is 3
Carlos 2022-06-24 07:49:25
Carlos 2022-06-24 07:28:51
<td class=”form-group col-md-1″ style=”text-align: right”> <input type=”text” class=”valor form-control_total input-sm” name=”salary_value” style=”text-align: right; vertical-align: middle; background-color: #acacac;” id=”salary_value” value=”{{ $salary_value }}” readonly></td>

And the interesting thing if I remove the name=”salary value” it doesn’t complain but also doesn’t come data

Carlos 2022-06-24 07:54:36
I put a dd($salary_value) and did it again with another salary value
Carlos 2022-06-24 07:54:49
and appeared in dd
Carlos 2022-06-24 07:55:03
laravel_discuss-126613.jpg

Carlos 2022-06-24 07:56:30
Carlos 2022-06-24 07:15:13
SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for integer: salary_value

but when I take the dd and click the submit button to save in the database, it gives an error.

Carlos 2022-06-24 07:58:51
In Controller
Carlos 2022-06-24 07:59:01
$calc = new Calculation;
$salary_value = $request->salary_value;
$calc->save();
Rahul Kahar 2022-06-24 08:02:07
$calc = new Calculation;
$calc->salary_value = $request->salary_value;
$calc->save();
Rahul Kahar 2022-06-24 08:02:17
Do like this
Carlos 2022-06-24 08:12:40
This complaint appeared in laravel
Carlos 2022-06-24 08:12:55
SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for type double precision: “2.462,26” (SQL: insert into “calculation” (“salary_value”, “total_finance”, “updated_at”, “created_at”) values (2.462,26, 1.920,56, 2022-06-24 02:08:07, 2022-06-24 02:08:07) returning “id”)
lailiseptiandi 2022-06-24 09:04:02
Change type data to varchar not double
anujrock1 2022-06-24 09:15:11
Carlos 2022-06-24 08:12:55
SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for type double precision: “2.462,26” (SQL: insert into “calculation” (“salary_value”, “total_finance”, “updated_at”, “created_at”) values (2.462,26, 1.920,56, 2022-06-24 02:08:07, 2022-06-24 02:08:07) returning “id”)

Youn need to remove , from it

2.462,26

2.46226this will work

|