Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by ginerjm

  1. So you are saying that your js code may be the problem here and NOT the php code? You have tested the php script previously and only now you can't get it to be triggered by an ajax call? Then maybe you s/b posting in a JS forum.
  2. As I said before - run the script yourself without the ajax call. Add a line to set your variable instead of looking for a post value. Add some echos to output things that may be relevant and echo out the results to the screen. Run it as if ajax was not involved and see what happens. Maybe make a new copy of it and play with it until you fix it and understand how it works. Maybe you just want a script that does exactly what you are saying you want to happen. BTW - is this script in your root folder and is "index" your default script name for php? That is not good if so.
  3. This is not what you had referenced before. So - what is the problem now? What message do you get back from your ajax call? The default error log name is "error_log" and would be located in the same folder as your php script resides in.
  4. Show us the php file in total, if it's not a lot of code. That or run it as a stand-alone script, providing the input value directly instead of from the POST array and add some output to it to display what is going on. It's called debugging.
  5. Ok - so you have defined your table to have 2 field/columns. And currently you have only one record. So when you want to update a specific record you really need to use a key value to identify the exact record you want to update. If you don't then every record that you may have in that table will be updated with the same streamid value. Is that what you want, assuming that there will be multiple records in this table at some future time? I assume that the "id" field is some kind of key value so perhaps you want to add that to your query statement to help it choose the record to be modified. Of course you have to make sure that this "id" will be unique in the table so the query will properly work
  6. You have only 2 RECORDS or 2 FIELDS? Makes a big difference. Records are "rows" in your table. Fields are "columns" within each and every record. By telling me that you "have only two records .... Id and streamID" you are saying that you have two fields in your record definition. Which is why I am asking how you are picking the record to be updated since your query statement does not have a "where" clause. PS - your line referencing the $_POST[test] value works but really REALLY should use quotes on the index value. Yes - php will eventually default to the proper element but it works better and faster and is more readable when you properly quote the index name as in $_POST['test']. This is basically true for all array references unless the index value is a variable name.
  7. But - which RECORD? Is there only one record in your table?
  8. As mentioned already you should be dumping out some of the vars to be sure they contain what you think they should. Also - do you have php error checking on just to catch some errors you may have? Such as $headers. You first create it as an array but then you append a string to it. I have no idea what you might have at that point so a var_dump of that would be important. And - don't use the @ sign to suppress things. If there is an error you should be handling it! Plus the From assignment is incorrect (I believe). It should be "From: xxx" not "From = xxx".
  9. When you do this update query WHICH record are you updating?
  10. I would begin with the invoice numbers table and perhaps add the user id to it. Then insert a new record there with the user id , then get back the just-created invoice number. You don't have to add the user id since you have it in the billable lines table already. Next time though you should think about your db design. BTW - where IS your user data stored, such as address, contact info, etc.? Second - you would then select those billable lines that match that user id and do not yet have an invoice number. The question that comes up tho is do you want to invoice ALL of these lines or do you give the user a screen to select those to be invoiced? Once you have decided on which billable lines are to go on the new invoice it's a simple matter to do an update query to add the invoice number to the matching billable line ids for that user id which would be a simple query, not a loop process. Read up on the "where in() " sql clause.
  11. not following all of your discussion but suggesting this: do not create unnecessary table entries for something already saved in the billable items table do create the user record for the new invoice id along with its date and anything else necessary add the new invoice id to EACH billable item in the billable items table. I assume that you already have the userid in that same table. no need for saving any kind of total since it can always be re-calculated using a query.
  12. Do you have php error checking on to catch any typos you may made in all of this new (and tedious) code?
  13. Why don't you compare the two sets of code (cause I am not going to!) and see what you changed. You do know you have a big chunk commented out?
  14. Hmmm.... 23 hours ago and no problem or code forthcoming. Guess this is resolved.
  15. I have not seen this done before so here's my question. If you do a fetchcolumn the manual says you can't retrieve any other column from that row again. You are attempting to do a fetch (of a whole row) after having done the fetchcolumn. I wonder if you would be retrieving the 2nd row of the results when you do the fetch (row) instead of the first row. If you only have one row returned what will the fetch call return to you - a False value? Why do you do the fetchcolumn anyway? Can't you just do a rowcount call instead?
  16. I see two pieces of code here - an html form and a php script that grabs the inputs from that form. Where is the problem?
  17. And do you already have the code that will handle the completed "full" cart? The payment logic perhaps? Seems like you are asking us for step #1 but will you then be asking for steps 2,3 & 4?
  18. When you receive the form the first time (and every time after that) create an array of the 'values' that were checked. When you output the form again, as you build the html code check that array for the values that need to be re-checked and check them as they are built. easy-peasy.
  19. Why dont' you show us what your code looks like now so we can help you?
  20. And how do you know the user? FYI - it helps if the forum users create just a bit more of a post if they want serious help. A post that doesn't say anything more than the title says isn't really giving us much to work with. You want "a code". Just what do you define that as? A block of code? A script? "Open this page"? Do you mean "open each page"?
  21. I'm assuming that the comment that is being replied to is currently being shown to the user as they type in their reply to it. You should be showing the comment id on that screen, perhaps as a hidden field inside the form on the page so that when the user submits his reply the hendling script (the updater) gets not only the reply text they will also get the comment id that was hidden on the page.
  • 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.