Save Data PHP MySQL

Could you help me, I have a problem.

I want to receive two values: data1 and data2 from hype and store them in a MySql table.
The routine works, but it only stores blank record in Mysql table.

What am I doing wrong?

Thanks for the help

Screen Hype

Screen PHP

Proyect (126.5 KB)

Chris, Thanks for your help.

The routine works, but you only store 0s in Mysql.

Apparently I am not associating the value entered in Hype with the java variable.
¿ How do you relate Hype's "text input box" to the variable created in the resultsend () function?

My apologies I speak Spanish and my translation may not be the best.

South America (123.2 KB)

Hi Luis,

I think your problem is that you are sending .text to the database when you really need to send .value as your input boxes can be changed.

I've made the changes to the file. Have a go and let me know if it works.


(Escena1) (122.1 KB)

Hi Chris
Thanks for your quick response.

I have made the changes, unfortunately it does not work.
Ha through value () does not enter records.
Ha through text () does not enter blank records.

I am attaching the project with a script from the DB, if you have time you could review it.

Thanks for your support. (312.5 KB)

It looks like you're using jquery; I believe the proper way is to use .val() and not .value() for input elements. Therefore resultsend() would have:

data: {
    dato1: $('#dato1').val(), 
    dato2: $('#dato2').val(), 
1 Like

Does this solve your problem Luis?

The other way would be to take the value of your input boxes and place them in a text element but hide this. Then send the text element to the database maybe?

Let me know how you get on

(I've moved the posts from the previous topic over to this one since it is about specific help)

It looks like the problem is that you use a Unique Element ID on the Hype element (dato1 and dato2), and also reuse them in the Inner HTML for the <input> fields. Therefore it is reading the .val() from the Hype element, which is blank. You should only have one unique element ID, so if you just remove them on the Hype element, and leave them on the inner HTML <input>, then it will work.

1 Like

I thank Chris and Jonathan for their help.

Apparently the error occurred because type = "text" was not declared in the data entry box.

How can I deliver a fixed value has "data2", an example assignment data2 = 1.
Support is appreciated.
Captura de Pantalla 2020-11-30 a la(s) 19.15.46


Glad you figured that out. If you need a fixed value, just put that value exactly where you have the cursor.

data: {
    dato1: $('#dato1').val(), 
    dato2: "my fixed value", 

Ok thank you very much

A post was split to a new topic: Clicking a button