Ok I am trying to update a specific area of a table in postgresql
I want it to find the user that goes along with the table
and then update the information I have
like in this case the email is the user name that it needs to look for.
it needs to add in areas like $aboutSelf, $hobbies, $music, $tv, $sports
so ya I have no idea how to do this lol ^.^ I only know how to add stuff from scratch. like create a non existing user
CREATE TABLE chatterprofileinfo(
Id SERIAL,
email VARCHAR(255) NOT NULL PRIMARY KEY,
aboutSelf VARCHAR(255),
hobbies VARCHAR(255),
music VARCHAR(255),
tv VARCHAR(255),
sports VARCHAR(255),
lastLogin DATE
);
The PHP im currently using
<?php
$error=false;
$aboutSelfError="";
$hobbiesError="";
$musicError="";
$tvError="";
$sportsError="";
if($_SERVER["REQUEST_METHOD"] == "GET") {
$aboutSelf="";
$hobbies="";
$music="";
$tv="";
$sports="";
$error=false;
}
else if($_SERVER["REQUEST_METHOD"] == "POST") {
$error=false;
$aboutSelf=trim($_POST["aboutSelfTA"]);
$hobbies=trim($_POST["hobbiesTA"]);
$music=trim($_POST["musicTA"]);
$tv=trim($_POST["tvTA"]);
$sports=trim($_POST["sportsTA"]);
if(strlen($aboutSelf)>255) {
$aboutSelfError="Maximum of 255 characters please shorten";
$error=true;
}
if(strlen($hobbies)>255) {
$hobbiesError="Maximum of 255 characters please shorten";
$error=true;
}
if(strlen($music)>255) {
$musicError="Maximum of 255 characters please shorten";
$error=true;
}
if(strlen($tv)>255) {
$tvError="Maximum of 255 characters please shorten";
$error=true;
}
if(strlen($sports)>255) {
$sportsError="Maximum of 255 characters please shorten";
$error=true;
}
}
?>