Dropdown doesn't update my database

QuestionsDropdown doesn't update my database
Nicolas asked 4 years ago

Hi,

I use an array to fill in a dropdown list, here are the parameters:

$col[“edittype”] = “select”;
$col[“formatter”] = “select”;
$col[“editoptions”][“value”] = get_dropdown($con,’Select id_priority, priority From ev_priority Order By id_priority’);

I created the function get_dropdown that returns me this array:

Array
(
    [0] => 0:No visitar
    [1] => 1:Alta
    [2] => 2:Media
    [3] => 3:Baja
    [4] => 4:Muy baja
    [5] => :->borrar
)

I can see the dropdown list in the grid but when changing a value, nothing happens

My field id_priority in the database is INT(1)  as values can be from Null to 4.

Message from Grid is “Record updated”

Should the grid normally return any message in case data do not suit the database field format?

Any idea of what can be happening?

Thanks

3 Answers
Nicolas answered 4 years ago

Hi, I found the answer, I has a mistake in field name “Priority” that I wrote with uppercase “P” and in my database was with “p”

$col[“name”] = “Priority”; -> the $col[“name”] = “priority”;

But whay do the grid tells me “Record updated”? ¿You don’t manage database errors?

Abu Ghufran Staff answered 4 years ago

Hello,

I rechecked your query about database errors. We do check fields and show database error if there is one.

In most databases, the query executes correctly even if field name is capitalized in update query. The reason for not displaying could be wrong JSON mapping of field and data records. It should have exact field name that is used in your SELECT SQL selection to map and display on grid.

_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Nicolas answered 4 years ago

Ok, thank you

Your Answer

16 + 1 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?