Verified:

Celphi Game profile

Member
EE Patron
6232

Jul 20th 2016, 6:55:48

I read on one of the posts the ability to delete emails.
Can we just add a button and send a query string to db?


<button onclick="deleteEmails()">Delete All Emails</button>
<script>
function deleteEmails() {
var ans = confirm("This will delete ALL emails!");
if (ans == true) {
ajax();
}
}

function ajax(){
var formData = {userID:"USER-ID-GOES-HERE",delete:"yes"};

$.ajax({
url : "PHP-FILE-HERE",
type: "POST",
data : formData,
success: function(data, textStatus, jqXHR)
{
//data - response from server
},
error: function (jqXHR, textStatus, errorThrown)
{

}
});
</script>

PHP-FILE-HERE

<?php
$userid = $_REQUEST['username'];
$ans = $_REQUEST['delete'];

if ($ans == 'yes'){
$sql = "UPDATE NAME-OF-TABLE-HERE SET msgs="" WHERE id=USER-ID-HERE";
$conn->query($sql);
}


I'm not exactly sure how you have your DB setup,. but you could also you DELETE FROM.
The HYPHENED data will have to be replaced by real values.

Edited By: Stryke on Jul 28th 2016, 19:05:03. Reason: Clarification.
Resistance is futile. You will be assimilated.

Marshal Game profile

Member
32,589

Jul 20th 2016, 13:32:23

what emails?
Patience: Yep, I'm with ELK and Marshal.

ELKronos: Patty is more hairy.

Gallery: K at least I am to my expectations now.

LadyGrizz boobies is fine

NOW3P: Morwen is a much harsher mistress than boredom....

Celphi Game profile

Member
EE Patron
6232

Jul 20th 2016, 15:03:30

Inbox messages.
Resistance is futile. You will be assimilated.

Stryke Game profile

Member
2068

Jul 20th 2016, 15:54:38

Yes. PLEASE! I have messages in my inbox that go all the day back to May 2013! They need to GO!
SOTA (President/HFA) • Elders • Darkness
http://sota.ghqnet.com

a.k.a. NightShade
Originally posted by kemo:
this dudes either a great troll or a seriously stupid fluff. the kind that takes the pepsi challenge and chooses jiff

Marshal Game profile

Member
32,589

Jul 20th 2016, 19:11:49

only 2013, i got 1 from 2010 and some from 2011 and rest.
Patience: Yep, I'm with ELK and Marshal.

ELKronos: Patty is more hairy.

Gallery: K at least I am to my expectations now.

LadyGrizz boobies is fine

NOW3P: Morwen is a much harsher mistress than boredom....

qzjul Game profile

Administrator
Game Development
10,263

Jul 22nd 2016, 17:14:11

I have 68 pages of inbox, going back to 2010
Finally did the signature thing.

qzjul Game profile

Administrator
Game Development
10,263

Jul 22nd 2016, 17:14:32

but yes, this is part of the eventual plan
Finally did the signature thing.