my query in sql does not recognize the parameter I sent from javascript

0

good afternoon programmers I have a doubt and I hope you help me I am developing a system in javascript and php and sqlserver, the problem is as follows this is the part of php in which he sent the javascript parameter that is "USU"

and I send it to call with a method

on another php page I have a button that does the following

I hope you can help me the main thing that I want to do is in javascript I'm going to call an element of the screen that is usu and if you pull it with the .innerhtml but once having it in javascript I want to send it to a php in order to make an insert in the database I hope your help thanks, or if you know another method to send the usable javascript to php I would appreciate it

if you can help me that the data usu that jale javascript from html can now take it in a query from php thanks

    
asked by costadark1212 01.08.2018 в 22:27
source

1 answer

0

You call us a function and the reality says you think that's your problem

 <input type="button" name="" value="enviar" onclick="usu()"/>

You have a problem in this line, the comma at the end is not going

$sql= "INSERT INTO ventas_Cuentas(cuenta,folio,cliente)VALUES(999,292,'.$usu.',)";

It should be like this

$sql= "INSERT INTO ventas_Cuentas(cuenta,folio,cliente)VALUES(999,292,'.$usu.')";
    
answered by 01.08.2018 / 22:48
source