Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. So this is really a Javascript issue, not an HTML one?
  2. These are mostly geared towards PHP-Editing but you can use them for HTML as well. Here's the sticky: http://www.phpfreaks.com/forums/index.php/topic,54859.0.html
  3. I'm having difficulty understanding you. Do you want to add 1 to a field? UPDATE table SET field = field + 1 Or, do you want to add one to field 'a' and assign it to field 'b'?
  4. Don't double post... http://www.phpfreaks.com/forums/index.php/topic,254035.msg1193680.html#msg1193680
  5. When I click on the link, all I see is the number '1'. Even in the view source...
  6. You must have posted it. I was confused myself because I clicked on both of your posts consecutively. You may be able to still edit it.
  7. Where is the private function confirm_query()? You need to post consistent code. Try using this class: class mysqldatabase{ private $connection; /* Class constructor */ function __construct(){ $this->connection = mysql_connect("localhost","teci","********")or die("Connect Error".mysql_error()); $this->connection = mysql_select_db("users")or die("Select Database Error".mysql_error()); } function query($sql){ $result = mysql_query($sql,$this->connection) or die(mysql_error()); return $result; } } $database = new mysqldatabase; return $database; ?>
  8. Please post your entire database class. In your constructor you have your connection string similar to? $this->connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS) or die(mysql_error());
  9. Oh jeez... Isn't connection supposed to be a variable?
  10. It's like having sex without a condom, a lot smoother, easier, and not to mention, faster.
  11. Maq

    RIPIE

    Impressive, now the disappearing trick!
  12. Looks fine to me. You said earlier that you got a warning? Please share. :'(
  13. Well what's the warning say? The SQL syntax looks valid to me... Maybe you should try to echo out '$sql' to see the string that's actually being passed to your function.
  14. Add this: $result = mysql_query($sql,$this->connection) or die(mysql_error());
  15. Yeah regex has saved my ass a couple times. It's definitely a good tool to have in your belt.
  16. No it's not, you're sending it to 'insert_user'.
  17. Something like this? $s= "[img=8949]"; preg_match_all("~\[img=(\d+)\]~i", $s, $matches); print_r($matches[1]); ?>
  18. tecmeister, you essentially repeated what the OP stated they already knew. That's what the manual is for: - move_uploaded_file - $_FILES Also how do you do the reverse, how do you know if someone didn't upload a file then press the submit button? Maybe this will help: if (move_uploaded_file($_FILES['uploaded']['tmp_name'], $target) { //on success } else { //on failure }
  19. Maq

    RIPIE

    Not sure what you mean. Your reply sounded like Johnny Cash from his San Quentin album. Oh Haha. Although my comment wasn't from one of his songs, I am a fan.
  20. Right, sorry: function numSuffic($num){ switch(substr($num,-1) ){ case 1 : return substr($num, -2, 1)==1 ? $num . 'th' : $num.'st'; case 2 : return substr($num, -2, 1)==1 ? $num . 'th' : $num.'nd'; case 3 : return substr($num, -2, 1)==1 ? $num . 'th' : $num.'rd'; default : return $num.'th'; } } for($x=1; $x{ echo "Congratulations you finished in " . numSuffic($x) . " place. "; } ?>
  21. I don't think there's a native function for this, AFAIK. function numSuffic($num){ switch(substr($num,-1) ){ case 1 : return $num.'st'; case 2 : return $num.'nd'; case 3 : return $num.'rd'; default : return $num.'th'; } } echo "Congratulations you finished in " . numSuffic(102) . " place."; ?>
  22. Try Googling, here's a tutorial - http://www.phpf1.com/tutorial/php-date-difference.html
  23. Maq

    RIPIE

    Not sure what you mean.
  24. Maq

    RIPIE

    We will not miss you IE6, and hope you rot in hell.
×
×
  • 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.