skip to Main Content

What is wrong with my mysql insert statement?

$sql = "INSERT INTO `liftcentrale`(`timedate`,`vraagaanbod`, `date`, `from_place`, `to_place`, `name`, `email`, `gender`, `smoke`, `extra`, `freeyesno`, `price_euro`, `firsttimeryesno`, `seats_offered`) VALUES (CURRENT_TIMESTAMP,'$vraagaanbod','$date','$from_place','$to_place','$name','$email','$gender','$smoke','$extra','$freeyesno','$price_euro','$firsttimeryesno','$seats_offered');"; echo $sql; //CHECK QUERY STRING if ($conn->query($sql) === TRUE) { echo "New record created successfully"; } else { echo "Error: "…

VIEW QUESTION

Sorting data based on JSON content with Laravel

I have a table in my database that stores a student's progress in a course. Schema::create('course_student', function (Blueprint $table) { $table->primary(['course_id', 'user_id']); $table->char('user_id'); $table->char('course_id'); $table->timestamp('lesson_timestamp')->nullable(); $table->text('course_progress')->nullable(); $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade'); $table->foreign('course_id')->references('id')->on('courses')->onDelete('cascade'); $table->timestamps(); }); Course progress is stored as a JSON object and consists…

VIEW QUESTION
Back To Top
Search