How store javascript value in database?
I'm trying to store the users BMI score and comments into mysql database. I'm able to store their height and weight but just not their score and bmi comment. Any suggestions would be appreciated. Show
asked Mar 8, 2017 at 20:01
Mal1234Mal1234 231 silver badge6 bronze badges 2 One thing you could do is change your You can always style your input boxes to match your paragraph text if don't like the appearance of boxes. For example, start with JavaScript
HTML
answered Mar 8, 2017 at 20:31
clarmondclarmond 3491 silver badge7 bronze badges 0 Elements with id output and comment are not
Another workaround is to use hidden answered Mar 8, 2017 at 20:22
C. MirandaC. Miranda 751 silver badge6 bronze badges Here is a solution to fit your question..
In your form:
answered Mar 8, 2017 at 20:36
YoloYolo 1,5491 gold badge11 silver badges15 bronze badges Not the answer you're looking for? Browse other questions tagged javascript php mysql or ask your own question.Can JavaScript store data in database?JavaScript allows us to store data in the browser using local storage API. Here, you can use LocalStorage and SessionStorage . The objects let us store data (in key/value pairs) and update it from the browser's storage. To view the data, open your browser.
How can we store form data in database using JavaScript?Use Case: Create a New Order. Define Queries. We will define two queries. ... . Generate XML Schema. ... . Create the Form. ... . Link to the Database. ... . Define the SQL Query. ... . Generate an XML Schema. ... . Create the Form. ... . Link to the Database.. How can we store data in JavaScript without database?You can use web storage. From W3Schools: With web storage, web applications can store data locally within the user's browser. Before HTML5, application data had to be stored in cookies, included in every server request.
How use JavaScript variable in php SQL query?php $var1 = $_POST['var1']; $var2 = $_POST['var2']; $getvalue="SELECT id,name from table1 WHERE column1='$var1' and column2='$var2'"; $result=mysql_query($getvalue) or die(mysql_error()); while($row=mysql_fetch_array($result)){ extract($row); echo $name; } ?>
|