From 47d09d6215d5774d7e5461b0bedb14676e3880b4 Mon Sep 17 00:00:00 2001 From: Finn Date: Mon, 26 Sep 2016 17:36:52 +0100 Subject: [PATCH] Changed DB column names where relevant --- foodloopserver.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/foodloopserver.pl b/foodloopserver.pl index 7643c2c..40c354f 100644 --- a/foodloopserver.pl +++ b/foodloopserver.pl @@ -80,9 +80,9 @@ post '/register' => sub { message => 'Token has already been used', }); } - my $insert = $self->db->prepare("UPDATE accounts SET 'name' = ?, email = ?, postcode = ?, age = ?, gender = ?, grouping = ?, password = ?, keyused = ? WHERE username = ?"); + my $insert = $self->db->prepare("UPDATE accounts SET fullname = ?, email = ?, postcode = ?, age = ?, gender = ?, grouping = ?, password = ?, keyused = ? WHERE username = ?"); $insert->execute( - @{$json}{ qw/ name email postcode age gender grouping password / }, 'True', $account->{username}, + @{$json}{ qw/ fullname email postcode age gender grouping password / }, 'True', $account->{username}, ); $self->render( json => { success => Mojo::JSON->true } ); @@ -107,9 +107,9 @@ post '/edit' => sub { message => 'Token has not been used yet!', }); } - my $insert = $self->db->prepare("UPDATE accounts SET 'name' = ?, postcode = ?, age = ?, gender = ?, WHERE username = ?"); + my $insert = $self->db->prepare("UPDATE accounts SET fullname = ?, postcode = ?, age = ?, gender = ?, WHERE username = ?"); $insert->execute( - @{$json}{ qw/ name postcode age gender / }, $account->{username}, + @{$json}{ qw/ fullname postcode age gender / }, $account->{username}, ); $self->render( json => { success => Mojo::JSON->true } );