0){ die("5"); //die("This post already exists"); } $tokenPrice = GetTokenPrice(str_replace(" ", "",$tokenCode)); // die("Price : $tokenPrice.$tokenCode"); $insertQuery = "INSERT INTO Tweets (id,created_at,author,text,tokenCode, tokenName, price_at_creation) VALUES($tweetId,STR_TO_DATE('$createdAt', '%m/%d/%Y %r'), $authorId, '$text','$tokenCode','$tokenName', $tokenPrice)"; //die($insertQuery); if(mysqli_query($conn, $insertQuery)){ echo "1"; }else{ echo "-1"; } if($tokenCode != "unknown"){ $tokenCheckSql = "SELECT long_name FROM Tokens WHERE code='$tokenCode'"; $tokenCheckQuery = mysqli_query($conn, $tokenCheckSql); if(mysqli_num_rows($tokenCheckQuery) <= 0){ //add new token } } ?>