This says I have an error on Line 15.
I'm hoping to add information and then for it to appear in a table. enter image description here
Parse error: syntax error, unexpected ';' in N:\ftp\compc\ac12mm\untitled folder\addContact.php on line 15
This says I have an error on Line 15.
I'm hoping to add information and then for it to appear in a table. enter image description here
Parse error: syntax error, unexpected ';' in N:\ftp\compc\ac12mm\untitled folder\addContact.php on line 15
Change your query like this way :
INSERT INTO TABLE_NAME (id,name, ...) VALUES (0,'name', ..) ;
You have forgot to close your $db->prepare
function.
Replace this(line 15):
$dbQuery = $db->prepare("insert into stock values (
null, :game, :console, :age, :genre,:price, :status, :stock, :purchased,
:low, :date, :picture,)";
With this:
$dbQuery = $db->prepare("insert into stock values (
null, :game, :console, :age, :genre,:price, :status, :stock, :purchased,
:low, :date, :picture)");
Also:
Replace this(line 16):
$dbParams = array('game'=> $newstockgame, 'console'=> $newstockconsole,
'age'=> $newstockage, 'genre'=> $newstockgenre, 'status'=> $newstockstatus,
'purchased'=> $newstocklow, 'date'=> $newstockdate, 'picture'=> $newstockpicture);
With this:
$dbParams = array('game'=> $newstockgame, 'console'=> $newstockconsole,
'age'=> $newstockage, 'genre'=> $newstockgenre, 'price'=> $newstockprice,
'status'=> $newstockstatus, 'stock'=>$newstockstock, 'purchased'=> $newstockpurchased,
'low'=>$newstocklow, 'date'=> $newstockdate, 'picture'=> $newstockpicture);
There is a semantic error in your code:
$dbQuery = $db->prepare("insert into stock values (null, :game, :console,
:age, :genre, :price, :status, :purchased, :low, :date, :picture,)";
Take a look at the end, you need to fix your line, somehing like that will work way better:
$dbQuery = $db->prepare("insert into stock values (null, :game, :console,
:age, :genre, :price, :status, :purchased, :low, :date, :picture)");
Removing the "," after "picture" and adding ")" to close your statement will make a valid php line.
EDIT: You also forget to add params for ":price", ":stock" and ":low" on line 16, so your query will probably fail if you don't set those variable.