Jump to content

Zane

Administrators
  • Posts

    4,362
  • Joined

  • Last visited

  • Days Won

    11

Everything posted by Zane

  1. btw, don't double post.
  2. trim trims whitespace from both ends ltrim trims whitespace from the left rtrim trims whitespace from the right
  3. Like has been mentioned already, you need a count to limit the otherfans. $count = 0; $alongWith = null; foreach($otherfans as $other) { $displayName = ucwords($other['firstname'].' '.$other['lastname']); $thisLink = "$displayName"; if($count == 0) $alongWith = $thisLink; if($count == 1) $alongWith .= " and " . $thisLink; if($count == 2) { $alongWith = str_replace("and", ", " $alongWith) . " and " . $thisLink . " with " . (count($otherfans) -3) . " others"; break; } $count++; }
  4. There isn't any real reason to learn actual JS unless you just don't have access to jquery. Then I could see the benefit of knowing JS. jQuery is a great framework.. awesome really. It has become so awesome that nearly everyone is using it nowadays as a JS substitute and in the past when that type of thing happens,.. you have a shiny new cult language. Much like how PHP started out.. as a simple framework. A way for someone to code lazily yet just as efficiently. If jQuery doesn't survive the years and stay where it's at in popularity then something else is bound to come along and "replace" JS again. Your question is essentially the same thing as asking if it's worth it to learn C. .. and the answer is, it won't hurt you if you do and it'll have it's benefits. There's really no cons to knowing a language.
  5. First off, you mispelled defaultValue.. secondly, jQuery doesn't have a builtin function for defaultValue this should be helpful http://www.miuaiga.com/index.cfm/2009/8/31/jQuery-form-input-defaultValue
  6. Yeah, most likely your connection is OK because you're getting a No Database Selected error, I'll bet you just mispelled your db.
  7. Weird, can't believe I missed that. Try putting mysql_select_db("data"); inside your AccountRelated function. preferably at the beginning of it.
  8. write isn't exactly a reserved word in Javascript http://www.webdevelopersnotes.com/tutorials/javascript/reserved.php3 Though it should be.. maybe that's an old post or something. Only way to find out is to use a different name for your function.
  9. it's onClick.. not onclick EDIT: well, I thought it was case-sensitive. Try setting a proper DOCTYPE
  10. I hate to be Cap. Obvious, but this would mean you haven't selected a database. Database are selected, in PHP, using the function mysql_select_db you don't have to assign it to a variable either... once you call the function, the database is used until you call that function again or you close the connection.
  11. Well, without going into too much detail. First off, this isn't a CSS question unless you already have these values handy. Secondly, those values can easily be obtained with MySQL calls, the you'd ideally put into a custom function. For instance, getCount() { $sql = "SELECT * FROM table"; return mysql_num_rows(mysql_query($sql)) } something to that effect.
  12. Awesome. Why didn't they come up with this earlier?
  13. If you're looking to imitate the sharing part, that's what's known as a sharing widget. http://sharethis.com/publishers/get-sharing-button There are several different versions out there and I'm sure they could be coded from scratch too, but why re-invent the wheel?
  14. do you have a screenshot or a page we can look at for reference?
  15. Maybe it's just me, but I think the date of the post should be beneath the title. Overall though, look great.. 2 thumbs up
  16. That's true as well, The main thing is what your DOCTYPE is.
  17. This topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=329211.0
  18. you could give them a numerical value instead. Otherwise, they'll just be ordered alphabetically.
  19. then $_POST['expYear'] or $_GET['expYear'] might possibly have no value. Then again, there is the possibility that it will, you never know until you try.
  20. Also, you will definitely need an ID column to use as a primary key, that identifies each and every submission. So.. along with PFM's suggestion, you need 18 columns. Preferably, the id column should be the first one. You do have that option when you go to add a column... "add to beginning"
  21. preferably, unless you're using AJAX.
  22. $value is not defined in your foreach you need foreach($_POST as $key=>$value) Also, if you include $value in your foreach statement, then $_POST[$key] and $value are the same thing.
  23. This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=328966.0
  24. Although I said you had multiple queries, I never said they were "useless"... I did mention their redundancy though. In your initial code, the one I didn't change, $extract_information and $does_exist_download are the same query. $extract_information = mysql_query("SELECT title,username,id,password,description FROM skins WHERE id = '$id' LIMIT 1"); . . . . . . $does_exist_download = mysql_query("SELECT title,username,id,password,description FROM skins WHERE id = '$id' LIMIT 1"); !$ determines if a variables is false or not, it doesn't tell you whether it actually exists. I said you didn't need curly braces .. not that you shouldn't use them. If you want curly braces then so be it, I won't lose sleep, but it helps condense your code and make it easier for another coder to read. I don't understand, but ok.
×
×
  • 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.