Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. Funny post. You show us one set of data and then show us code that doesn't match it. Confusing.
  2. Do you get an error message? You do realize that a checkbox doesn't return a value unless it is checked? You really need to validate your input vars and NOT use them directly in your query statement to avoid injection. Also might help to see your html.
  3. Aha! So it's not an unknown format. Leave it to the Gurus to recognize that! Kudos Jacques1 - AGAIN!
  4. 1 - the sample you provided seems to be readable but when I read into deeper I sense that your sample is not a good one since there is a consistency problem. For ex., the 'a' element seems to indicate an array but there is no closing brace 2 - What is your table layout - just one field? 3 - You want to take data from this complex format and put it into a similary non-dataprocessing-friendly format? Why? IMHO - the best approach would be to convert this table into a proper database format (looks like it might need at least 3 tables from your sample) and then you would have a useful data source. Which - if you really have to - would be easier to dump to excel.
  5. Bravo Jacques1!! I wish more of us here on this forum felt the same as Jacques when answering obvious student project requests for help. OP - You are at university to learn and are probably paying good money to do so. So LEARN! As Jacques says - when you have something YOU have written and need help with some portion of it, then ask here. We are not un-paid professors, but we can be free tutors.
  6. First thing I would do is consolidate your tables into one db. Why have 3 databases for common data?
  7. You're storing the body element of an email in your table without trying to identify the individual parts of that email first? How do you know the 'body' is actually in the format you expect it to be in? Is this email a free-form entry from some user? Do you send back a confirmation email that lets the user know that what they think they sent you is actually what you interpreted it as? And - when you store this email, how do you identify it? You have all the content in one field - that means no keys, no dates, no tracking of any kind. Kind of defeats the purpose of maintaining a database, don't you think? If it were me and I absolutely had to obtain data this way, I would try to extract the data from the email and store it as a temporary record in a well-designed table with a reference key. I would then send the collected data items along with the reference key as a hidden field back to the user and ask for a reply that confirms their submission was correct. When that email comes back to a "special" address I would have another script designed to be triggered by emails coming in to it that would look for the reference key, locate the 'temporary' record and re-key it with the user's name (?) as the key and consider this entry as a valid one. Your current method of obtaining this data is flawed. GIGO - remember that? No self-respecting data processer would ever do what you are doing.
  8. Have you tried doing any reading on how to program in php? You aren't understanding what you have been given. First - did you create the function as Jacques showed you? Second - you use that function for EACH item that you want to output. Third - you can't just add an echo since the foreach will only loop thru the single line I gave you. You need to enclose all lines to be executed by the foreach in curly braces. A little light reading of a php source is what you really need to do.
  9. Be sure to read and follow Jacques advice - I should have done what he did. Good practice makes for safe code.
  10. Try foreach ($songStmt as $song) echo $song['artist'] . " - " . $song['title'] . "<br>"; Much better looking output.
  11. As safe as your hosting co. keeps it and as safely as you keep your account password.
  12. I don't see any submit button. I see a 'button', but it is not a submit. Now if you are doing some kind of submit in your JS code, that's a whole other situation. 1 - eliminate the blank line at line 2. Could be a problem later on. 2 - Do you get the input form displayed? 3 - Does your browser indicate any errors in your JS code? 4 - Since you have your own session process do you rely on any session vars in the included files prior to turning on your sessions?
  13. Which script is not responding? Turn on php error checking. Do some debugging like add an echo at the top of your problem script to see if it is getting there. Add an echo to output the contents of the POST array as in: echo "<pre>",print_r($_POST,true),"</pre>"; to see what you are receiving. Focus on one script to make sure everything is correct then move to the next so you don't get confused.
  14. I have no idea what you want. Good luck
  15. Many people (me as one) do not like to click on links that go to unknown places. The site also allows for the posting of code which makes it much safer for all to see your concerns.
  16. Sounds like you are asking for real-time db updates to happen as the user adds input. Sounds like an AJAX call to me.
  17. Again - people usually post their Pertinent code here.
  18. What's a slug? People usually post the Pertinent code here using the proper code tags, ie, php and /php wrapped in square brackets.
  19. You asked: Is there a way I can only record the data if Link does not exist? My answer means - do a query to SEE if the Link already exists before you try and insert it. Is that not clear?
  20. Do a query for 'link' before you try the insert? PS - you can simplify your current syntax with this: $citable = "insert into TableName (Company, Form ,Date, Link) values('$fnumI', '$form', '$msqldate', '$Flink'); Plus - I believe that 'Date' is a reserved word. Try re-naming that column to make your future use of this table less problematic. Also - you should be sanitizing these inputs. Try using a prepared query instead of this method.
  21. sure looks like a 2-dimensional array reference to me. But yes I see what you mean. I certainly don't think the OP ever thought of it that way though!
  22. Now that I understand. So the value of $comp might be not what you want. As I see it the key value of your 'answer[]' array is the id you want. Yet you are using the comp input which I believe you have appeneded an extra value to. $comp = $row['id'][$i] is going to give you this assume id='1' from your table and $i is 3. $comp will end up being invalid since $row is not a 2 dimensional array. Skip the comp element and just use the $k value you already have.
  23. Upon EVER More Further Review: I now see the insert. Don't know how I missed it. That leads to the question - you're showing us your process of some input, but not the actual html producing that input. Can we not see the incoming form for this script? The form you are sending out here I assumed was the one you are using for future input, but I see now that it is not.
  24. I have no idea what you mean by "not getting the id of my questions saved" since you don't show us any code involving "saving". One thing that puzzles me is this: $comp = $row['id'][$i]; The result of a fetch is a one-dimensional array. You are trying to use it with two. Try turning on php error checking (in my sign.) and see what error message(s) you get. As for your question - please elaborate. Upon Further Review: You are placing your radio buttons in td elements but you have NOT built a proper html table. Is this the problem you are having - simply not SEEING the radio buttons with the id values you have assigned?
  25. You are building an html table with tables embedded inside of row elements? Whatever does that do for you?
×
×
  • 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.