» Data is not inserted through a form in MySQL (Coding is in PHP)
Data is not inserted through a form in MySQL (Coding is in PHP)
|September 15, 2014
Posted by forumadmin
I’m trying to insert data into mysql database through a form using php script.I am not getting any errors,bt the information submitted by the form is not inserted into database..instead of the data(which is submitted by form),the values inserted in database are (1,1,1,1,1)..is this also an type of SQL injection attack?(as i searched on web nd got this attack name)
here’s my php code for inserting data into database..
<link rel="styleheet" type="text/css" href="clubcs.css">
<div class="segment_header" align="center">
die('Could not connect: ' . mysqli_error($con));
$sql1=mysqli_prepare($con,"INSERT INTO clubdata (FirstName, LastName, Address, City,Contact_no)
$sql1->bind_param("ssssi", $first, $last, $addr, $city, $contact);
if(isset( $_POST["first"] ) && isset($_POST["last"]) && isset($_POST["addr"] ) && isset($_POST["city"]) && isset($_POST["contact"]) )
echo "Thank You" ." " .$_POST["first"];
echo " You have Successfully registered with us!";
is there something that i’m not getting or missing? Plz suggest me any solution!!
More Related Questions
- Create a Search records form through Boostrap Modals PHP MySQL I'm building a form within a Boostrap Modal, it has 3 INPUT fields and a Submit button for each row. Each Submit is POST onto another page. What I then want to do is use the variables to […]
- How to submit a form which contains mysql generated dropdown lists Ive got a property website im working on for a school project http://www.holidayaviemore.com
I have three dropdown lists which have all been generated from a mysql database.
I have added […]
- Saving file pathname to mySQL database using PHP Sorry if this question is really long winded but i want to be as detailed as i can in hope of getting an answer to my problem.
Basically i have a multipart form that i want to add file […]
- SHOW COLUMNS, Dynamic variables, INSERT INTO.. implode? This form is getting columns names from table pracownicy. It's dynamic because these are names of applications that a new employee is going to use on his computer when he start working for […]
- How to post many text boxes in one form to databases I have this script where I want to post values from the form into my database. I want to post many text boxes into one form.
The problem is, only the last text box gets updated.
- How to add the time form was submitted I have this page below, which is the action when you submit a form.
I am wondering how you can add a time function to this, to add the time that the form was submitted to my database […]
- JMeter Running Out Of Memory At 400MB on WAMP I am running form submission tests on a website (WAMP) to create new users. Currently, my thread breaks when moving from 6-7 users to 8. The current configuration which breaks is:
- CakePHP 2.x Saving multiple models with foreign keys I'm currently building a multi-step form submission website that involves a single form going through several steps and being updated by several users (not concurrently). For example a […]
- Drupal 7: Field input generated by wizard I'm new to Drupal, but not new to PHP/MySQL/etc...
I have several forms that are completed by the user when performing various actions (upload, edit, create, etc). One of the […]
- Inserting data into MySQL database using PDO I'm new to PHP and MySQL and I'm trying to insert data in to a database, which had worked fine until i attempted to use PDO's prepare method. It returns the catch error and i cannot figure […]