Jump to content

TecTao

Members
  • Posts

    145
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://www.TecTaoDesigns.com

Profile Information

  • Gender
    Not Telling

TecTao's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Yes there are five other fields, three that are identifiers to the particular businesses. Two are categories of those businesses. These fields were added early on years ago but are not necessary to any applications. The consumer_mgmt table handles sending out various emails for different specials. So we are finding multiple emails going out to the same recipient that had been added multiple time. I just need to pare it down so that there is one customer email for one business. There is a field of the date of entry so if there were the need to identify which of the multiple emails should be removed, it could be the oldest. I see where you are going with this, how would the script decide which entry stays and which ones get deleted.
  2. I need Delete Duplicate Email Records That Are Attached To One Account But Can Be Found In Multiple Accounts I have a table, consumer_mgmt. It collects consumer information from various forms. These forms are available through different pages that are part of a business package. A business can offer these signups to gather names and emails from consumers for various types of specials they may offer. So a consumer my be in the consumer_mgmt table 5, 10, 15 times for that particular business. But, that consumer may be in the consumer_mgmt table multiple times for a different business. So multiple times for multiple businesses. I need to remove duplicates for each business account so the consumer is only the consumer_mgmt only once for each business. There are approximately 15,000 rows currently in the consumer_mgmt table. I'm not sure where to begin on the logic. Since there are multiple business accounts that the emails are attached to, would one have to build a case for each loop?
  3. Thanks CroNiX, I understand your explanation. I read up on your in scope link and see what you are talking about. I move the $todayRepost35 into the function. I'm not clear completely on you point about never calling your function. Is this specific to the echo of the results? As I work on building this, I wanted to see the row results to verify it is selection the correct rows. If it does, then I will add the specific commands using the variables from each row. From what I have read and illustration, I assume that these commands are outside the function, and will loop through each time from the query in the function until completed. An example is below <?php $unLink1 = "/home/zipclick/public_html/specialslocator.com/FAP_Images/$FAPforSale_IDnumber/$FAPforSale_image1"; //echo $unLink2; unlink($unLink1); $unLink2 = "/home/zipclick/public_html/specialslocator.com/FAP_Images/$FAPforSale_IDnumber/$FAPforSale_image2"; //echo $unLink2; unlink($unLink2); $unLink3 = "/home/zipclick/public_html/specialslocator.com/FAP_Images/$FAPforSale_IDnumber/$FAPforSale_image3"; //echo $unLink2; unlink($unLink3); $unLink4 = "/home/zipclick/public_html/specialslocator.com/FAP_Images/$FAPforSale_IDnumber/gick.php"; //echo $unLink2; unlink($unLink4); $dir = "/home/zipclick/public_html/specialslocator.com/FAP_Images/$FAPforSale_IDnumber"; rmdir($dir); mysql_query("DELETE FROM FAP_forSale WHERE FAPforSale_username = '$con_username' AND FAPforSale_IDnumber = '$FAPforSale_IDnumber' "); ?>
  4. I am writing a CRON job that will execute daily. First it will identify from a MySql table the date in a field 'FAPforSale_repost35' If the date is the today date it will then execute commands to delete photo images in a directory, delete the directory, and finally remove the record from the database. I am on step one which is to build the array of records that match the days date. When I run the code, there are no errors but I am not getting results even though the records in the test table are set for today. Below is the select <?php define( "DIR", "../zabp_employee_benefits_processor_filesSm/", true ); require( '../zipconfig.php' ); require( DIR . 'lib/db.class.php' ); require_once( $_SERVER['DOCUMENT_ROOT'] . '/_ZABP_merchants/configRecognition.php' ); require_once( $_SERVER['DOCUMENT_ROOT'] . '/_ZABP_merchants/libRecognition/MailClass.inc' ); $todayRepost35 = date("Y-m-d"); echo $todayRepost35; function repostEndSelect() { global $db; $this->db = $db; $data = $this->db->searchQuery( "SELECT `FAPforSale_IDnumber`, `FAPforSale_image1`, `FAPforSale_image2`, `FAPforSale_image3`, `FAPforSale_repost35` FROM `FAP_forSaleTest` Where `FAPforSale_repost35` = '$todayRepost35' "); $this->FAPforSale_IDnumber = $data[0]['FAPforSale_IDnumber']; $this->FAPforSale_image1 = $data[0]['FAPforSale_image1']; $this->FAPforSale_image2 = $data[0]['FAPforSale_image2']; $this->FAPforSale_image3 = $data[0]['FAPforSale_image3']; $this->FAPforSale_repost35 = $data[0]['FAPforSale_repost35']; echo $this->FAPforSale_IDnumber; echo $this->FAPforSale_image1; echo $this->FAPforSale_image2; echo $this->FAPforSale_image3; echo $this->FAPforSale_repost35; } // ends function... echo( ' Finished...' ); ?> Thanks in advance for any suggestions or direction. Chapter two will be when I start testing the commands to delete.
  5. Thank you Requinix. This clears up issues and much to think about.
  6. This is something I've been trying to figure out for some time. I've read blogs and other forums and am still not clear. Seems that when I pass a variable that has Apostrophe's in the variable, from a form page to the submit page and insert it into the MySql DB table, it inserts OK without any / before the apostrophe. On the other hand on the same submit page, there is a select query from another table and there are variables with apostrophe's. These queried variables keep the variables from the form page and the queried DB from inserting into a new table. So I use mysql_real_escape_string () for the variables queried from the table to be inserted into the new table, don't use mysql_real_escape_string () on the variables passed frm the form page, and everything inserts into the new table just fine. Displays with no forward slashes. My confusion comes from when to use mysql_real_escape_string (), stripslashes () and htmlspecialchars(). Also in the reading I was doing, it looks like mysql_real_escape_string () is being replaced with mysqli_real_escape_string (), but when I tried to use it on a variable queried from the DB something like $username = mysqli_real_escape_string ( $s['username'] ) ( $s being 'foreach ( $result as $s )' from the select query. Thanks in advance for shedding any light on this.
  7. I may be mistaken but I think that would still put the original email in the header. Tyring to do an Anonymous Email like on Craigslist.
  8. I have built a small classified ads application. A person can put in an item for sale and it will diaplay the item. On the input form for the ad they enter their email address. I am looking for an application that will display an anonymous email address on the classified ad and send to the anonmmous email through to their real email address. I would prefer to do this through the web server of the client and not have to set up a Google Apps or third party email accout for the "catch all" account. Any recommendation for tutorials to explain and illustrate how to write this code. Thanks in advance for any assist. m
  9. I'm useing a simple HTML drop-down list box. But now I want to be able to and an editable drop-down box so that if the particular item in the drop-down is not changed it won't update the database. But if a new value is selected it will update the DB with the new value. I am not clear on a couple of things. should the valuse of the drop down be in a seperate DB table. And then the script to change the new value or keep the old. I've googled this and can't seem to find a workable solution. Thanks in advance,
  10. Yes I saw that and made complete sense. Didn't know if there were any other approaces such as error logs and the such. thanks for all the help.
  11. Thanks for your comments Psycho. I see now what you and Barand are saying. You first comment about the conditions no being arbitrary makes complete sense. Any suggestions on where I might start on debugging. I am weak on that and it would help in solving the problems I come with. Again, thanks.
  12. Thanks. I did try And and OR in place of && and ||. I don't think that's the problem. The code is not recognizing the $num_row count and then applying the conditions of the elseif statements.
  13. I am looking to identify a particular company records from a table that holds multiple records of the same company but with different criteria such as source of payment and row count to delete a specific record from two table and update a third. The ifelse statememts don't working. There are 4 conditions. First is if the paid source = "MT1000". Second is if the paid source = "2411". The third condition is if the Row Count >= 2, and the forth condition is that the Row Count == 1. Even though on a particular query the row count is 2, the condition returned is Row Count = 1. If I remove one record and switch the order of the last two conditions, the row count is 1 but returns the Row Count <= 2. $result = mysql_query( "SELECT COUNT(1) FROM townSponsor_OBC_tools WHERE ts_obc_username = '$ts_obc_username' AND ts_obc_userID = '$ts_obc_userID'" ) or die("SELECT Error: ".mysql_error()); $num_rows = mysql_result($result, 0, 0); echo 'Row Count: = '; echo $num_rows; if ( $ts_obc_paidSourcee == 'MTM1000' ) { echo "This Paid source is MTM1000 and Nothing is done"; } elseif ( $ts_obc_paidSourcee == '2411' ) { echo "This Paid source is 2411 and Nothing is done"; } elseif ( $num_rows == 1 || $ts_obc_paidSourcee <> 'MTM1000' || $ts_obc_paidSourcee <> '2411') { echo "Row Count is = 1 and paid source isn not MTM1000 or 2411"; mysql_query("DELETE FROM townSponsor_OBC_tools WHERE ts_obc_m_orgIDSponsor = '$ts_obc_m_orgIDSponsor' AND ts_obc_username = '$ts_obc_username' AND ts_obc_userID = '$ts_obc_userID'"); mysql_query("DELETE FROM townSponsor_members WHERE tsm_m_username = '$ts_obc_username' AND tsm_m_userID = '$ts_obc_userID' AND tsm_assocID = '$ts_obc_m_orgIDSponsor'"); mysql_query("UPDATE users SET zabp_paid = 'NEW_S' WHERE username = '$ts_obc_username' AND id = '$ts_obc_userID'"); } elseif ( $num_rows >= 2 || $ts_obc_paidSourcee <> 'MTM1000' || $ts_obc_paidSourcee <> '2411') { echo "Row Count is >= 2 and paid source isn not MTM1000 or 2411"; mysql_query("DELETE FROM townSponsor_OBC_toolsTest WHERE ts_obc_m_orgIDSponsor = '$ts_obc_m_orgIDSponsor' AND ts_obc_username = '$ts_obc_username' AND ts_obc_userID = '$ts_obc_userID'"); mysql_query("DELETE FROM townSponsor_members WHERE tsm_m_username = '$ts_obc_username' AND tsm_m_userID = '$ts_obc_userID' AND tsm_assocID = '$ts_obc_m_orgIDSponsor'"); } Thank you in advance for any insights or suggestions.
  14. I posted a topic earlier and there was confusion as to what I could not work out. I am able to display the checkbox, either checked or unchecked depending of the value or 1 or 0 in the obcDisplay field. <input type="checkbox" name="obcDisplay" value="<?=$r['obcDisplay'] ?>" <?=($r['obcDisplay']) ? 'checked="checked"' : ''; ?>/> I am trying to update the DB table by the checkbox. If the checkbox is checked (obcDisplay = 1) and I uncheck the box and submit, I want the table updated so that obcDisplay now equals 0. When the form is displayed, the checkbox is now uncheck (obcDisplay = 0). Now I check the box and submit and the update changes the field from 0 to 1. I can display the checkbox as checked or unchecked by the DB field obcDisplay being either 0 or 1. It is changing the value where I am having the problem.
  15. Using the 1 or 0 as the value would make more sense. What I am having trouble understanding and making work would be, if 1 = checked and 0 = not checked. And the field for a particular user in the user table is set to 0 which returns an unchecked checkbox, I want to be able to check the box, click submit and update the DB field obcDisplay to a 1, and back and forth. <input type="checkbox" name="obcDisplay" value="<?=$r['obcDisplay'] ?>" <?=($r['obcDisplay']) ? 'checked="checked"' : ''; ?>/> so I put the result from the query to display the content of the obcDisplay field in the value = and it does display the correnct 1 or 0, and if it's a 1 the box is checked, if it's a 0 the box is unchecked. It's updating the table with the new 1 or 0 that I can't get my arms around.
×
×
  • 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.