Answer the question
In order to leave comments, you need to log in
Data not being entered into MySQL table?
There is a field where the user enters data, there is a button that sends this data to $_GET
, after that the $_GET
data gets into the database, but only numbers are entered into the database, but lines are needed, in the database the type is text.
Form
Code: Submission Code:echo "<input type=text name=question>";
$question_text = $_GET['question'];
mysqli_query($link, 'INSERT INTO `html_questions` (question_id, question_text) VALUES ('.$i_question_id.', '.$question_text.')');
Entering numbers
Database
Entering letters
Database
Answer the question
In order to leave comments, you need to log in
Text values in a SQL query must be wrapped in quotation marks.
Better yet, take a tutorial and learn what prepared queries and sql injections are . Your code is a red carpet inviting hackers to break into the site.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question