0

I'm trying to add a simple form data to a mysql databse and it seems to not work.

It gives me this error

Parse error: syntax error, unexpected ';' in portfolio-add-website.php on line 7

and portfolio-add-website.php looks like this:

<?php
include 'connect_db.php';

$connect = mysqli_connect(HOST,USERNAME,PASSWORD,DB);

mysqli_query($connect,"INSERT INTO portfolio_websites 
                       (name, link, description, profile_img_name, 
                        cover_img_name, client_name, donedate) 
                VALUES ('$_POST[name]', '$_POST[link]', 
                        '$_POST[description]', 
                        '$_POST[profile_img_name]', 
                        '$_POST[cover_img_name]', '$_POST[client_name]', 
                        '$_POST[donedate]')";
?>

I don't see any unexpected ";". Can anyone help me? I'm sure it's something small.

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
Razvan Cuceu
  • 587
  • 2
  • 5
  • 24

1 Answers1

2

You missed a closing brace

mysqli_query($connect,"INSERT INTO portfolio_websites (name, link, description, profile_img_name, cover_img_name, client_name, donedate) 
VALUES ('$_POST[name]', '$_POST[link]', '$_POST[description]', '$_POST[profile_img_name]', '$_POST[cover_img_name]', '$_POST[client_name]', '$_POST[donedate]')");
Arun Krish
  • 2,153
  • 1
  • 10
  • 15