-
Posts
4,362 -
Joined
-
Last visited
-
Days Won
11
Everything posted by Zane
-
btw, don't double post.
-
trim trims whitespace from both ends ltrim trims whitespace from the left rtrim trims whitespace from the right
-
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++; }
-
What Are Reasons to Learn Actual JavaScript When I have jQuery?
Zane replied to chaseman's topic in Javascript Help
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. -
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
-
Yeah, most likely your connection is OK because you're getting a No Database Selected error, I'll bet you just mispelled your db.
-
Weird, can't believe I missed that. Try putting mysql_select_db("data"); inside your AccountRelated function. preferably at the beginning of it.
-
Got code?
-
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.
-
it's onClick.. not onclick EDIT: well, I thought it was case-sensitive. Try setting a proper DOCTYPE
-
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.
-
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.
-
Awesome. Why didn't they come up with this earlier?
-
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?
-
How do I take input and put it into a table.
Zane replied to VinceGledhill's topic in PHP Coding Help
do you have a screenshot or a page we can look at for reference? -
My First Wordpress Theme Which I Created with Your Help!
Zane replied to chaseman's topic in Website Critique
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 -
That's true as well, The main thing is what your DOCTYPE is.
-
This topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=329211.0
-
you could give them a numerical value instead. Otherwise, they'll just be ordered alphabetically.
-
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.
-
How do I take input and put it into a table.
Zane replied to VinceGledhill's topic in PHP Coding Help
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" -
preferably, unless you're using AJAX.
-
$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.
-
This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=328966.0
-
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.