Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. rogerte

    How to parse associative array

    I've looked at the Javascript code and have found what the problem is! It was building the array structure as a string, so was passing a stringified string I've amended it and it now works ok. Sorry if I have offended you, but thanks for the help
  2. rogerte

    How to parse associative array

    Sorry if I am being dense, but as I said new to JSON - have only ever used $_POST before, and I'm doing this to help out a local charity in my spare time so really appreciate your help. I have been using Googled examples to set up the code, assuming it to be correct, so have removed the header...
  3. rogerte

    How to parse associative array

    Thanks for your help. Back in the office and have loaded correct version of HTML document, and tried it out, but am now getting an error in the PHP foreach line. However I tried your code and that worked as expected. I have noted though that the print_r output is different to the output seen...
  4. rogerte

    How to parse associative array

    Have just been talking to the guy who wrote the original javascript, which has never been used until now, and he says it's a mistake - the JSON output should have been: [ { "id": 1, "stext": "a string", "sdate": "09/11/2023", "bid": "7", "cid": "6"...
  5. rogerte

    How to parse associative array

    I'll post it when I am back home - but it'll be edited as the strings contain information that is identifiable.
  6. rogerte

    How to parse associative array

    I have a json_decoded string passed by AJAX array in the format : Array ( [dta] => [ { "a" : 1, "b" : "string" , "c" : ""}, { "a" : 8, "b" : "string 2" , "c" : "12/12/2022"} ] [vars] => [ 7, 12 ] ) The items pointed to by dta need to be looped through...
  7. rogerte

    Code that works on Windows, Android and Iphone

    I have written a program for internal use using, mainly, PHP, but also has a lot of Javascript. It works absolutely fine using WIndows devices (including Windows phones), Android phones, and for the most part iPhones, but there are some items that don't work properly using the latter. Generally...
  8. rogerte

    Javascript updating form control not working

    Thanks for the response feherke, As you have probably guessed I am new to Javascript/PHP, in the process of (slowly) converting a desktop, Delphi, system to web-based. Had never even thought about the situation you describe, and haven't looked at JSON before. Must admit web programming is...
  9. rogerte

    Javascript updating form control not working

    Have found what the problem is: It's the php variable $invitetext. If it contains any line breaks (which it should do because the text is going to be an email body) then it doesn't work. If a single line of text it works ok. Have to insert a unique a unique code (llbb) in the PHP variable...
  10. rogerte

    How to have several datepickers on same HTML page

    Finally found a completely different way of doing this so please ignore this question
  11. rogerte

    Javascript updating form control not working

    Have form that has a select list, change button, textarea and submit button. When page is loaded PHP sets up variables, and the textarea and submit button are disabled with the textarea displaying placeholder text. What should happen is when the user selects an item from the list and then...
  12. rogerte

    How to have several datepickers on same HTML page

    During this lockdown period I have decided to help a local sports charity by finishing-off an online management system written using, primarily bootstrap 4 and php. One thing I want to do is a system to set up dates that sessions will be available for forthcoming term. So I set up a form with 6...
  13. rogerte

    Saving table data to MySQL

    I have just about finished my first ever PHP project (a Sports Club Management System converted from a Del[phi app) and I am left with one thing to complete. The attendance register. More specifically saving the data back to the MySQL table. Everything else works fine Basically the attendance...
  14. rogerte

    SELECT Query works in phpMyAdmin but not in PHP program

    Thanks for response. The echo came back as unknown field A.class_id in field roster So I changed all the occurrences of A. to attendance. and all the B. to memberdetails (obviously removing the AS A and AS B) and it now runs ok. Puzzling to understand why that should happen.
  15. rogerte

    SELECT Query works in phpMyAdmin but not in PHP program

    Hi, If I enter the following SELECT statement in phpMyAdmin it works ok SELECT A.class_id, A.attend, A.mem_id, B.firstname, B.lastname FROM attendance AS A INNER JOIN memberdetails AS B ON B.mem_id = A.mem_id WHERE A.class_id=5 ORDER BY B.lastname, B.firstname ASC but if I try the following...
  16. rogerte

    Unselected Listbox values

    I finally sorted it by combining code I found on the web. Probably not the most efficient code, but it works! Function to create string of all items in listbox: <script> $(document).ready(function() { $("#submit1").click(function() { $("#form1").submit(function() {...
  17. rogerte

    Unselected Listbox values

    Right her is an extract of my code At the top (before the HTML tag <?php require_once 'session.php'; require_once 'conn.php'; /* Code to get username to display on HTML page */ $acc_query = $conn->query("SELECT * FROM `admin` WHERE `admin_id` = '$_SESSION[admin_id]'") or...
  18. rogerte

    Unselected Listbox values

    Apologies for not replying sooner, have been away for a few days with no access to the internet. I will be back in the real world soon, and will upload a synopsis of what I have done so far. Basically I am using some JQuery I found online to control the 2 listboxes and the buttons that move...
  19. rogerte

    Unselected Listbox values

    Thanks for that reply - looks like I will have to start learning Javasript as well as starting PHP [sad]
  20. rogerte

    Unselected Listbox values

    Another newbie question! I know you can get the option value of selected items in a listbox from the $_POST variable, but is it possible to determine all items in a listbox (selected and unselected) following a post submit. What I am trying to achieve is: A form has 2 listboxes. By selecting...

Part and Inventory Search

Back
Top