Jump to content

DarkWater

Members
  • Posts

    6,173
  • Joined

  • Last visited

    Never

Everything posted by DarkWater

  1. You have to use z-index and position: absolute if I remember correctly.
  2. #!/usr/bin/php That's called a shebang line.
  3. <?php $int = -19; if ($int < 0) { echo "neg"; } else { echo "pos"; }
  4. UPDATE users SET gold = gold - 50; That will lower EVERYONE'S gold by 50, so you probably want a WHERE clause.
  5. PHP won't automatically do that. You must be calling htmlspecialchars() or htmlentities() somewhere.
  6. Lol, you said the word "professional" in a sentence that was related to his site. Ironic. xD
  7. Might I ask why you seem to absolutely adore using caps lock?
  8. @Maq: No, he's not. @Thread starter: nl2br() is indeed the answer. You'd want to use it on the text when you DISPLAY it, not when you store it.
  9. No, it's a browser thing...there's pretty much nothing that can be done about it.
  10. Yeah, it's the $ sign. Take that off.
  11. Actually, let me rewrite it so you get the matches grouped how you wanted: !\((.+?)/([^)]+)\)!s
  12. sprintf() doesn't actually execute the query, it just lets you create a format string and it helps when you're making queries IMO. Look sprintf() in the manual if you're really curious. The syntactic part of the query is the SQL-standard way of doing an UPDATE. I think you should get a new PHP book, because PHP is so unlike how it used to be that anything older than 5 years is considered extremely outdated in my book.
  13. Your syntax is completely messed up. Go read up on SQL syntax. Here is what your query SHOULD look like: $query = sprintf("UPDATE rb_notes SET image_thumb = '%s' WHERE id_notes = %s", $thumbnail, (int) $id);
  14. I don't think he really got the point of any of these posts. Let me summarize: [*]The layout is disgusting. It's cluttered, horribly designed and it doesn't even validate. [*]I can't think of a good reason as to why anyone would use whatever service your site provides (which I actually have trouble figuring out...). [*]You are completely open to SQL injections and your site could probably be killed in a matter of seconds. [*]???? [*]PROFIT! Sorry 'bout the last two items, I had to.
  15. Yeah, that's what I was trying to say.
  16. I think I see the problem. In your UPDATE query, you don't actually use an ID in your WHERE clause so it ends up updating EVERYTHING on each pass of the foreach loop. =/ Also, you need to put the shebang line as the first line in the file for it to do anything I think.
  17. Don't use array_push(), by the way. It's incredibly slow compared to the native array syntax: <?php if (mysql_num_rows($countriesresult)>0) { while ($row = mysql_fetch_row($countriesresult)) { $country_array[] = $row[0]; } } print_r($country_array);
  18. //pretend we're in the loop: if ($row['total'] > 1) { //multiple } else { //one }
  19. I hope you're not "MEGA LOL"-ing at his word of warning, because you can easily edit dropdown menus and send WHATEVER you want to a script if you have half a brain.
  20. SELECT *, COUNT(*) AS total FROM tblVideos GROUP BY videoTitle; I think.
  21. If the only reason to do this is to "save room in the table", don't bother. MySQL can handle terabytes of data.
×
×
  • 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.