Jump to content

ginerjm

Members
  • Posts

    6,906
  • Joined

  • Last visited

  • Days Won

    99

Everything posted by ginerjm

  1. I have no idea what you posted back to my list of things you are doing. Why don't you show us you 'new and improved' code and tell us what is not working with it?
  2. I suggest that the code you are looking at is not the code that is being run at that time. Try altering the message and running it again.
  3. You're saying that your argument in the query is the value 1? Meaning you are trying to delete the record where amp20ptid equals 1? And that the record is deleted despite the query error? I think that the record never existed since I'm pretty sure that the query isn't running. Regardless of the above, your script is rather convoluted. 1 - you make a connection which we will assume works 2 - you then do a query to select your entire table 3 - you then grab an incoming value from the post array 4 - using that input you do a delete of the matching record (which php/mysql indicates has an error in it) 5 - then you are supposed to do the query again - which if the first one ran should basically do nothing Is that what you are intending? echo out your query statement before you run it just to ensure it looks like what you intend.
  4. When you ask for help here it is a good idea to not post blind code that has no context and for which you have not provided any English translation of its context. What are we supposed to do - guess what you are trying to do as well as solve your problem? Why not start again and tell us what you have posted and what it is supposed to be? Then give us a synopsis of what you are expecting that code to do.
  5. I have no idea what your post is. That first piece of code - what is it? If it is supposed to represent an array, it's a syntax I am not familiar with. If it's not, then what is it? And what is your question exactly? Output a message like what?
  6. What is the exact problem? For one thing you are not passing the 'code' parm in your uri
  7. And we are assuming that despite your input field containing multiple data items that you are NOT storing that way in your db table. You should have a hashtag table that has a user id field and a hashtag field and your table will then have multiple records for a user as in: user tag john #tag1 john #tag2 john #tag3 john #tag4 Mary #tag1 Mary #tag2
  8. Then he should get a solution from the teacher or from the other students so that he gets something appropriate for the context of his course.
  9. Hopefully you have realized that good database organization is how you properly manage any and all data. By having it well designed you are then able to write queries to answer any question at any time without having to do things like you proposed in your post. No need to move data to another table, no need to remove data when it 'expires'. You simply store your data and query it and format the output to answer any question that is asked. Yes - you eventually may remove data that is beyond use, but I suggest that you develop a process to archive the old data so that you can analyze it over long periods of time if that is the nature of your activity/business.
  10. You skipped a class, a test no less, and you want someone here to write your answer for you. SHAME ON YOU AND SHAME ON ANYONE HERE WHO GIVES YOU WHAT YOU ASK FOR.
  11. What do you want US to do about it? You didn't even show us the line that is giving you the error.
  12. You began with the premise that you have a db2 table and you have a php application. What IS that php application? Or did you mis-speak? I would also add - if you have a task to do and you don't know how to use php, then why don't you use something that you DO know?
  13. I have no problem with it if you follow my instructions as well as everyone else who adds their $.02. Inside, outside, any side - Don't Create Stupid Code!
  14. You want to be sure that the name you create doesn't wipe out another file. I think 'name integrity' is an apt term. Dont' you? Your concern is about the possibility of two instances of your script creating the same random name at the same time. Even tho I don't quite follow your convoluted logic (and wasted logic) I dont' think that's going to happen.
  15. Are you opening up your own image museum? What are you worried about? What is "working out" supposed to mean? Basically what I see in your posts is : 1 - accept an image that you allowed someone to upload thru your form. 2 - rename that image and store it someplace To be safe you have asked how to ensure name integrity. You have been offered the quite simple solution of checking if that filename exists in your images folder before saving the new file there. Case closed?
  16. In case you don't realize what gristol is telling you - YOU ARE DOING SOMETHING VERY STUPID HERE. 1 - separate your code (php) from your html - makes no sense to mix them all together. 2 - Read the manual for any one of the MySQL_* functions. NOTICE THE BIG RED BOX SAYING NOT TO USE IT!!! 3 - Do not in any way allow the user to write your query for you. What?! Are you that stupid that you would let someone actually write a malicious query that could delete your entire database - not just a table - your entire database? 4 - Check your work before posting it for others to work with. You have an input tag that you "attempt" to close with a </textarea> tag. What the h. is this? 5 - Where ever you got this code - return it and don't use anything from that source again. You have no idea what mistake you are attempting to make. Lastly - what you are trying to do is called AJAX. It allows you to have a page that contains JS code that will call a php script and get a response from it and post that result back to the page without doing a refresh. Depending upon the speed of your connection and your server it can be quite instantaneous. I think that is what you want. You should read up on THAT too.
  17. Maybe post this in the CMS section if you want to reach the joomla experts.
  18. Try googling how to use js to open a window and you will see how you can generate a window of the size you want as well as trigger a php script to take over that window. I think that is what you want.
  19. Why not post in the wordpress section? The functions you are using mean nothing to those who don't use it.
  20. Same silly code again. When are you going to stop using it? As for ensuring no duplicates, how about just using a file system function to check if it already exists?
  21. Basically you want to write some code like this: if $_POST['id'] is not set, output a form that has one text field for the id and one submit that calls back to this script using POST, not GET when it is submitted and exit and wait for the input. if $_POST['id'] is set, then grab it, validate it, and use it in a prepared query to get the data you want to display. Using those query results ($pdo->fetch(PDO::FETCH_ASSOC) ) build some html to display these fields in whatever order you want. You can use an html table, or some div tags to arrange it on screen. Be sure to place some submit buttons on it to handle what ever you want to do next. Then exit and wait. This is a very simple solution. You need to be safe and secure in handling the user input and writing the query.
  22. Try echoing out the value of $piccurr to be sure it is what you think it is. As a matter of practice one should always wrap indices in quotes when specifying them literally. For ex. you s/b using $nt2['Picture01'] And what exactly does this 'diddly squat' look like? A blank page? An error message? Anything?.
  23. Your English is not clear enough to me. Quote: 'script in JS would then create/open windows with php code' makes no sense. One can't have php code inside a js script. What are you trying to describe here? Again - you use js to open the window and pass control to the script named as one of the parms of the JS open command. You simply have to port all of your curren tphp code from the calling script to the JS-called script.
×
×
  • 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.