Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. 1. Use code tags. 2. What format is the list of 100 post codes now? 3. in_array
  2. As I said, if you've already fetched it, you don't NEED to fetch it again. Your third block of code is the only part using mysql_fetch_assoc. Is that where you're having trouble?
  3. You don't, if you've already fetched it once you don't need to fetch it again.
  4. I'd also use jQuery because it's so much easier in the long run. If you don't want to do that, you need to look at the onClick() event in pure JS.
  5. Are they correctly encoded in the table? Is your document set to the right encoding? You may need to use utf8_encode() on the text.
  6. If I have a table that has columns id (primary key), name (vchar) and then (other columns that don't matter) And I can do this query to get all the names which exist more than once. SELECT count(id), name FROM tbl GROUP BY name HAVING count(name) >1 I get a number of rows that are 3, name I want to delete 2 of the 3 rows, starting with the ones with the higher IDs. Is there any way to do this in a query? I tried doing a subselect in the delete, but get an error and I'm stuck on the syntax. This would also delete all three if it worked I guess. DELETE FROM tbl WHERE name IN ( SELECT name FROM tbl b GROUP BY name HAVING count(name) >1 ) Error #1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT ....
  7. Update item_category SET category_id=1 where item_id IN(166, 167)
  8. line 16 includes everything until the ; use the manual to check these things.
  9. I've thought about teaching but I can't stand teenagers.
  10. For future reference, the word you're looking for is apostrophe. But typically we call them single quotes.
  11. usernamechecker.php - is this file in the same directory as the one in your URL? You should probably use the full URL just to be safe. Install Firebug and you can easily debug this stuff.
  12. Like "Memory"? My high school programming class the final was basically "come up with a program". That was it. So I made hangman (this was a Java class). So, after I finished the program, I asked my teacher "So, how do I send this to my Grandma so she can play it?" He said to just send her the files. So I did, and of course she had no idea what to do with it. He says, have her download the SDK. I'm like you nut I'm not telling my GRANDMA to download the SDK just to play this game, can't I make it a program she can run on it's own? He couldn't figure out how to do it. I had already hated Java, so I decided to learn PHP instead, on my own. I guess in a way I should be grateful to that guy. He was kind of just an idiot though. He was impressed that my program used a text file of words.
  13. I'd start with accepting that you should have paid attention in class. Problem solving. It's all programming is.
  14. Well I'd do the corners in the image but there might be a better way.
  15. You mean you want it to output it in real time as it loads it?
  16. As far as I am aware, the only way to do that in IE8 will be using a transparent .png.
  17. Go through the code and understand what it does. If you don't understand what each line does, you need to.
  18. Really? Does anything about that look right? Do you understand what your code is doing?
  19. Wait, why did you post here then?
  20. If you add an extra $data = fgetcsv($handle, 1000, ","); before the loop it'll skip the first. You can also use an if and keep track of the line numbers.
  21. You would either do it in PHP or do the same thing as described in my post here: http://forums.phpfreaks.com/index.php?topic=362361.msg1714461#msg1714461 SELECT IF(col IS 0, 'No', 'Yes') as col If that doesn't help post your code.
×
×
  • 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.