Jump to content

phppup

Members
  • Posts

    632
  • Joined

  • Last visited

Everything posted by phppup

  1. For code that does not work, the attempt is appreciated, but not as much as a reply that resolves my issue. Your code did not work. Nor did it address the problem ( (as no update option was included. AJAX seems like a nice way to view data in my table. But I need a way to utilize it. Is there a way to Cchoose aspecified record and UPDATE it?
  2. After several attempts of adjusting this code and creating database tables, it appears not to work and has failed. Perhaps I should rephrase: hope do I use the selected item from an AJAX generated search so that the specific record can be updated in its table? Any helpful info, links, examples would be appreciated.
  3. This looks similar to what I've got: another AJAX developed menu. So, back to my question: after I make a selection, how does I carry the values and UPDATE the record? EG: I select John Smith with tele 5554321 and need to change his girlfriend's name from Mary to Wanda. I need to be able to UPDATE the correct corresponding record.
  4. Please re-read my initial entry. The dropdown-style is created with AJAX pulling data from the columns in distint rows (whether 'name' and 'phone' or 'state' and 'abbrev'). I created the following as a way to see it. function Delta(){ var x = document.getElementById("typ").value; document.write("You selected <b>" + x + "</b> as your choice."); In what manner would I use you suggestion as an alternative??
  5. The AJAX that I've got is end result of several suggestions and resources. The full story and it's reality for an end result may untangle the confusion. I have a form for customer information that inputs data into a table. That works fine. This customer information corresponds to other related data (ie. last sale, amount, etc.) through a non-disclosed index number. Since there is a likelihood that a 'first name' and 'lastname' may be duplicated (more than one John Smith), it is imperative that the correct record be updated. Enter AJAX, which enables user to enter keystrokes that narrow the field of John Smith's dynamically. The Smithers, Smithsons, and Smithers have been visually eliminated from the dropdown-style display. Now, there are three John Smith choices. In addition to 'firstname' and 'lastname' is 'phone'. This can be used to validate that from the choices, the correct John Smith is selected (with the associated [hidden] index. Great up to here. The table is populated, the data is dynamically visible. John Smith with'phone' 5551224 is selected. And then, NOTHING HAPPENS. I need to carry the 'phone' or the index to the next phase in order to update his girlfriend's name or add today's sale data. This is where I've stalled.
  6. Ummm, no. I posted originally in PHP and the post got moved to this forum. I would prefer a PHP solution (but will try this for educational purposes). Still would like the PHP method. Thanks for the help.
  7. Even if I stagger the execution intervals of job 1 and 2, there would be no guarantee during a presentation that there is no delay, at which point cron2 would run before cron1. Unless my thinking is wrong, I would like to run cron1 and incorporate something similar to a js script saying "wait 5 minutes and execute cron2." Can this be done?
  8. In its current form, the script does nothing more than dynamically display information contained in the table. I want to be able to now utilize it. Knowing that California (as 'state') exists does me no good if I cannot select it to update 'abbrev'. This is only a template right now. Simplified plans would replace 'state' with 'customer' and 'abbrev' with 'satisfaction'. In that case, customer Smith would be selected from Ajax. His satisfaction with our service is a 10. Today, he was disappointed and the 10 needs to be UPDATED to a 3. Currently, I am unable to satisfy that criteria t through a form because I cannot 'grab' there variable information and retain it for page 3.
  9. The table (which has not been coded bc I realized this issue) would simply likely refer back to an identifying retirement 'id' with rows 'sale'(a positive number), 'credit' (a negative), and 'current_balance' (for the running total). Obviously, I could always SUM both columns and do basic math tho calculate a total. My problem is how to get to the last balance (in the prior row corresponding to the particular 'id' and running a continuously updated cycle. In Excel it would be E2+C3-D3 to equal E3. My problem is getting to E2 (the last/previous sale record for this customer).
  10. After trolling the internet, I have managed to piece together enough information to accomplish the creation of a working Ajax script which dynamically shows the contents of a table column when a user types inside a text input field. So, the data from table STATES provides the 'name' field California and the 'abbrev' field CA. This seems to be accomplished when the first php files connects to the second php file through: $.get("backend.php", {term: inputVal}).done(function(data){ Now I want to put the selected information to use. How can I attach/connect 'name' or 'abbrev' so that these variables are selected in a third file update.php so that CA can be altered to "Cali" The input field displaying this info is name= 'typ' and I've managed to create a JavaScript: function Delta(){ var x = document.getElementById("typ").value; document.write("You selected <b>" + x + "</b> as your choice."); But this displays the information as a string. It seems like the long way around to use Java Script to disassemble the string and isolate each variable. And then, of course, I need to pass it to update.php Please help.
  11. How can I calculate a running balance using PHP? I have a table that will record both sales and credits and would like to display a cumulative balance. It seems redundant to have to revisit every individual transaction and recalculate the current balance each time it is required. How can I set up an additional column named "balance" and use it as a reference point against the newest entry for the specific customer? What is the best method of achieving a checkbook-style method?
  12. How can I calculate a running balance using PHP? I have a table that will record both sales and credits and would like to display a cumulative balance. It seems redundant to have to revisit every individual transaction and recalculate the current balance each time it is required. How can I set up an additional column named "balance" and use it as a reference point against the newest entry for the specific customer? What is the best method of achieving a checkbook-style method?
  13. I have created a Cron job that will send an email to new subscribers when they register. A second email will be sent a week later. For demonstration purposes, waiting more than a few minutes for the second email is not practical. Is there a way within PHP to set a timeout function, so that email number two can be initiated shortly after email number one?
  14. I am creating a database with the personal information of customers at a small business. Many of the customers are local residents, while some are business owners. For those customers with businesses, the company name and a corporate designation is desired. For purposes of database normalization, is it really necessary to create a separate table for these two pieces of information. What is the real downside of having two more rows in a single table? Helpful information appreciated.
  15. I'm starting of with a simple form to gather information and then store it in a database. While researching methods and techniques I discovered this: $firstname = mysql_real_escape_string($_POST['firstname']); $lastname = mysql_real_escape_string($_POST['lastname']); $email = mysql_real_escape_string($_POST['email']); Is it necessary to run mysql_real_escape_string for every item? Is there a more effective/efficient manner to handle this? Is there a better approach from a security standpoint? Please educate me.
  16. Thanks a ton. I have already begun doing some homework regarding AJAX and quickly learned that it sometimes (as I'm my case, naturally.. LOL) fails when used from smartphones. I will test your script and the others I've uncovered in tutorials tomorrow.
  17. So AJAX just makes the effort more dynamic? What an I searching for to learn and find what I need?
  18. Now we're making progress. Brand's suggestion is what I had in mind. I've never used AJAX and don't know if it might be a good exercise or an unnecessary complications. Opinions?? Again, I haven't written code for this yet, but suspect my biggest dilemma will not be searching for ask the Bob Smiths, but then shifting that data to assist in a form whereby the employee can select the radio button to submit new data to the account of the correct Bob Smith (verified by his address and/or telle number). This is where I was looking for some template that I could use for guidance.
  19. Does anyone start at the top? All of this was covered in my initial post. If you step away from the ridicule and READ the actual information you may discover that this is not as monumental as previous posters have concocted. @feasability: the owner wants it. This, it is feasible since all employees know how to speak. @new employees: they will be trained like monkeys to smile, say hello, and ask for the customers name. No additional ID required. Radical, isn't it?!?? So, back to the ISSUE created a week ago. The details are simple and outlined and clarified in my first and second posting. Thank you.
  20. This is for a small town business with a local customer base. The idea of a bar code system is good but cost prohibitive. However, the expense of a laptop and a few clicks by the friendly retailer that already knows everybody's name could help develop a better marketing plan. Setting up the database should be the most expensive piece. And I am doing this for free.
  21. Thanks Zane. But no, I am not trying to track website analytics, although I may take a look at this link for future reference. At this point I am trying to track physical visits to a physical store with actual communication between a live employee (at a cash register) and a local customer base. I just want to help this mom-and-pop shop have tangible data to determine who their best customers are, and possibly build up the weaker patrons.
  22. If you READ the first line of my first entry I said "I am in the beginning stages of (trying to develop) a customer tracking database and would appreciate guidance and direction." What occurred in my thought process was the realization that THIS particular step will give me a problem. I do not expect or want anyone to do the work for me. What I asked for was to be pointed in the right direction BEFORE wasting time wandering through the forest. If there is a recommended methodology or a best practice, it would probably take less time to explain it or offer the few lines of code as a template versus the keystrokes to dance around without lending assistance.
  23. I spent 3 days explaining a post that I thought was fairly clear and said: Please provide any coding help or direction that would help me with a dialogue box asking "Do you mean Bob Smith with this address/phone number?" Or perhaps list all the Bob Smiths from Anytown so that the correct one could be selected and the information could be attached to the corresponding customer's account. And you expect me to be able to develop it now because..... ? Maybe we should see if anyone else has some input.
  24. Yes, step three is where i am unsure, as the new form needs to be created from output but used for input. And the radio button needs to be properly associated. Can you give me an example of what the code should look like, so that I have a starting point?
  25. Agreed and understood. Now I need to bring up a dialog box (or some other recommended tool) that will allow the employee to select (via radio button, checkbox, or suggested method) the Bob or Kathy that has the address and/or phone number that corresponds with the information provided by the customer so that the correct record is updated. This is the step that has me unsure.
×
×
  • 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.