Jump to content

systemsgotyou

New Members
  • Posts

    7
  • Joined

  • Last visited

systemsgotyou's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am trying to copy two pieces of info from a table into a new table. I know if I wanted to do one piece of data it would look like this: $getemaipips = "SELECT emailaddress FROM zzemail_list_subscribers LIMIT 1"; $getemaipips_rst = $database->prepare($getemaipips); $getemaipips_rst ->execute(); /* * */ foreach ($getemaipips_rst->fetchAll(PDO::FETCH_ASSOC) as $data) { $email = $data['emailaddress']; $newlistid = $twentyfivedaylistid; But if I wanted to do that for TWO fields how would it look? Can I do a select AND command?
  2. I want to copy it from one field (the 10 digit version) and then copy it to another field as the date version like above. I am 99% sure it has to do with the datetime() function. Any help?
  3. Hello, I need the php way to take this kind of mysql datetime field: 1390146482 and make it into this kind: 19/01/2014 I already know how to get and insert, I just need some help with translation. This datetime thing is confusing!
  4. You are a godsend! So I keep the $data = array(); $data = $sthandler->fetch(); Right?
  5. Hello. I am new. I have simple two step process I want to be done. When it does work the webpage keeps going (im guessing it's an endless loop)... I can't seem to get it to work: I know there's something I'm missing about this PDO array stuff. <?php include("database.php"); $time_ago = strtotime("-1 minute"); /*find subscribers over a month old with the thirtydaysubs table*/ $checker = "SELECT emailaddress FROM aa_thirtydaysubs WHERE subscribedate < $time_ago"; $sthandler = $database->prepare($checker); $sthandler->execute(); /*then move it to main list and remove from 30 day list*/ $data = array(); $data = $sthandler->fetch(); if ($sthandler->columnCount()){ while($sthandler->fetchAll(PDO::FETCH_ASSOC) !== 0){ $email2 = $data->fetchColumn(0); $newlist= "2"; $updatelistid = "UPDATE zzemail_list_subscribers set listid = :newlist WHERE emailaddress = :email"; $sthandler3 = $database->prepare($updatelistid); $sthandler3->execute(array(':email' => $email2, ':newlist' => $newlist )); $clearars = "DELETE FROM aa_thirtydaysubs WHERE emailaddress= :email"; $sthandler6 = $database->prepare($clearars); $sthandler6->execute(array(':email' => $email2)); } } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.