Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About TecTao

  • Rank
    Advanced Member

Contact Methods

  • Website URL

Profile Information

  • Gender
    Not Telling
  1. I've been out of coding for about 4 years. My client called and said that they upgraded his server and now nothing works. I've don't done some reading and see that there are changes to queries. I originally wrote the program using mysql_query which is now deprecated replaced with MySQLi and PDO_MySQL which I thought would be that simple. Apparently not. My code is below. The error I get is Fatal error: Call to undefined function MySQLi() in /home1/zipclick/public_html/marketingteamates.com/_ZABP_merchants/main-w.php on line 304 which leads me to believe that the upgrade is now solely object oriented. $result = MySQLi( "SELECT * FROM $users WHERE username = '$username'" ) or die("SELECT Error: ". mysqli_errno()); $num_rows = mysqli_num_rows($result); while ($row = mysqli_fetch_array($result)) { extract($row); }
  2. 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.
  3. 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?
  4. TecTao

    A Select Array Not Showing Results

    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' "); ?>
  5. 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.
  6. Thank you Requinix. This clears up issues and much to think about.
  7. 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.
  8. 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.
  9. 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
  10. 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,
  11. TecTao

    ifelse By Row Count Not Working

    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.
  12. TecTao

    ifelse By Row Count Not Working

    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.
  13. TecTao

    ifelse By Row Count Not Working

    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.
  14. 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.
  15. 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.

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.