Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. Stop just removing and adding things without understanding what they do, for one thing.
  2. Do you think we can see your screen? Saying you removed "the brace" is ambiguous. So is "an error". Think about what's missing from your posts now. Always always always post your errors and your code. I didn't tell you to remove the brace, especially not the ending brace. I told you to read the docs on control structures. How are these two sections of code different? foreach($reasonData as $reason => $reasData) echo '<p>' . var_dump($reason) . '</p>'; foreach($reasonData as $reason => $reasData){ echo '<p>' . var_dump($reason) . '</p>'; } What about these two? foreach($reasonData as $reason => $reasData) echo '<p>' . var_dump($reason) . '</p>'; echo "Test"; foreach($reasonData as $reason => $reasData){ echo '<p>' . var_dump($reason) . '</p>'; echo "Test"; }
  3. You have enough posts that you should know by now saying you go "an error" is not going to get you any help.
  4. foreach($reasonData as $reason => $reasData) echo '<p>' . var_dump($reason) . '</p>'; {if ($reason !=0) { This is where your problem is. For one thing, when your answer is "i just copied and pasted it", that shows you don't understand the actual code. Lookup the syntax for control structures like foreach and if. See if you can figure it out from that.
  5. {if ($reason !=0) { Why do you start the line with a {?
  6. @Barand I think his user id var is empty too.
  7. Echo the entire query. Post the section of PHP code. Read this post: http://forums.phpfreaks.com/index.php?topic=365029.msg1730174#msg1730174
  8. :facewall: Thanks for testing it out, I guess there is some other issue I'm not seeing. I'll keep working on it.
  9. Why don't you just use an auto increment field? And why are you adding "-" just to take them out??
  10. You would need to make an ajax request each time, the PHP page would return new information each time.
  11. That's a comment, telling you what the code should do. And yes, that is what it means.
  12. :/ I don't have any new information to add, I tried writing them again hoping maybe I had made a mistake I can't see, and got the same result - the update with the case statement runs, no error, but makes no changes. Then the single update runs and makes the change.
  13. It's too bad I didn't already provide that.
  14. Maybe a community college course then.
  15. It takes a lot of research to learn all of the security issues. You're not doing research though, you're just grabbing random scripts and asking is this one ok? what about this one? Rather than searching for an actual script you can take and use, you need to be searching for information about the entire IDEA, and researching web security. You won't get a unified answer on "THIS IS THE WAY TO DO IT" because there are lots of ways to do it, and lots of competing ideas on what is best. There is no one right answer. It's like asking which political party is "correct". ETA: If there were one truly right answer, no one would ever get their user's information leaked by hackers. Yet it happens every week. LinkedIn had their user's passwords stolen. It happens to BANKS, FFS.
  16. I guess a better description of what the OP wants would help. OP only selected user_id, so it would work that way except he's running the query for every title, so he's going to get each user for each title.
  17. NEVER RUN QUERIES IN LOOPS. Do 1 query at the start. SELECT DISTINCT user_id, title_id, prog_id FROM title_views GROUP BY title_id, prod_id
  18. I am trying to do a one-time cleanup of some data that needed to be normalized. I have "rejection reasons" which have now been mapped to "rejection_code_id". I need to update a table that has no rejection_code_id for some of it's rows, and give it the right ID based on the entry in the historical_rejection table. Relevant columns: historical_rejection: rejection_reason candidate_id candidate_TEMP: candidate_id rejection_code_id rejection_code (not used in the update) rejection_code_id rejection_code_value I was doing them one by one, and the data got refreshed from the prod site and wiped out all my changes. one-by-one query: UPDATE candidate_TEMP c LEFT JOIN `historical_rejection` r ON c.candidate_id = r.candidate_id SET c.rejection_code_id = 1019 WHERE rejection_reason = 'Sample Rejection 1' AND (rejection_code_id = 0 OR rejection_code_id IS NULL) I thought I could do it in one query using a case. I tried to do these two at once with my case, and it said 0 rows affected. I also tried using rejection_reason IN ('Sample Rejection 2') instead of just the = because I will have more than one map to the same new ID (typos in the old data), but that gave the same result. What's wrong with my new update?
  19. I think you'll want to get a library that helps you build a Word document.
  20. YOU STILL HAVE A COMMA WHERE THERE SHOULDN'T BE ONE. No wonder you don't get any help here. You refuse to actually learn.
  21. Contrary to how it might seem some days, we don't just sit here waiting for your next post. Some of us work for a living and use this forum as a place to take a break. I was going to answer your question about WHY I suggest inner join, rather than left join, but now I'll just say JFGI.
  22. *headdesk* You still have a comma where there shouldn't be one. What do you *think* the code you've posted does. Why are you sending 3 arguments to that function? Why doesn't the last_name as author part show up in your final query?
  23. What do YOU THINK? Did you TRY changing it yet?
×
×
  • 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.