
artacus
Members-
Posts
737 -
Joined
-
Last visited
Never
Everything posted by artacus
-
The function I wrote doesn't take any arguments. But you could probably just do it onSubmit(). Otherwise say user wants to select col 3 on row 2, if you check w/ onChange() it will throw an error because 3 is already selected in row 3. Otherwise you'd have to write a better function that unchecked 3 in row 3.
-
I concur, what you're doing doesn't make sense. Nonetheless, you can use PHP to read the file and generate a JS array in your document.
-
You can load it with AJAX instead of doing a refresh and not get the click.
-
[SOLVED] Can this be done without using subqueries?
artacus replied to artacus's topic in MySQL Help
Well the problem is that I have a bunch of assessments (about 12 test groups, 100 tests & 800 test strands) and I am trying to map these so I can find out where each piece of information is located in the database and then generate statistics and averages for the district, schools and classes. Most of the tests occur at a given time (1st, 2nd, 3rd trimester) so its easy to pull that information. But because reading fluency is given year round, I'm having a hard time mapping it. If there were a work around to get @mtd to work, it would have fit in with all of my other assessments but now I'll have to calculate the stats w/o mapping them. -
Well your field name changed from Date to maxDate so if you didn't account for that, your dates wont show up.
-
Ok, I think I'm starting to get you now. You could make your life much easier if you only stored the id's of the related categories in your field. Once again I'm going to make an assumption that the 15 in Fabric(15) is the category id for Fabric? Yes? If so, I'd change your keywords to only store the ids like so "2,4,5,7,9,15" Then you can join your categories like so: [code] SELECT cat.* FROM products AS p JOIN categories AS cat ON FIND_IN_SET(c.id,p.keywords) WHERE p.id = 42 ORDER BY cat.id DESC LIMIT 3[/code]
-
Which PHP-Editor do you think is the best?
artacus replied to briananderson's topic in Miscellaneous
Wow, I can't believe no one else uses PHPEclipse. That is my workhorse. Although I'll use dreamweaver when I'm doing heavy html editing w/ just a little PHP. And gvim/vim is great when there's a lone file (PHPEclipse works w/ projects) or you need to make a quick change and just ssh to the server. Back when I was using that OS with the Start button, I used Magumo, but they would regularly introduce bugs and it would take them too long to fix. -
[quote author=ober link=topic=118291.msg485236#msg485236 date=1166153259] I added the option, you twit. And I'll vote on a topic wherever I damn well please. [/quote] Someone needs to add another option lik, "I don't really have anything useful to add to the discussion because I don't even use the OS in question, but I've got an over inflated ego and I do whatever I damn well please."
-
Sorry to be short. I just wish more people would make a serious effort to put the pieces together on their own. Anywho: [code] SELECT emp.Passcode, emp.status, emp2.Surname, DATE_FORMAT(MAX(emp.datetime),'%m/%d/%Y') AS maxdate FROM emp JOIN emp2 ON emp.Passcode = emp2.Passcode GROUP BY emp.Passcode[/code]
-
LOL. My wife bought me a "Brain" stuffed animal thing (rather than call it a doll) that sits on the dashboard of my car. And one night I got pulled over by state troopers about 3 AM. They were pretty cool and left me off with a warning. As the one trooper left he said, "Are you pondering what I'm pondering?" Being the consumate smartass, I retorted, "Narf! I think so Brain. But where are we going to find a rubber hose and a policeman at this hour?"
-
[code] <input type="radio" name="imgPicker" value="1" onClick="setImg(this);" /> function setImg(rbtn) { var targBox = document.getElementById('myTextField'); if(rbtn.value == 1) { targBox.value = '<img src="img1.png">'; } else { targBox.value = '<img src="img2.png">'; } } }[/code]
-
*Sigh* Why does everyone want spoon fed? Why don't you TRY to work it out yourself and if you are still stumped in an hour, I'll write it for you.
-
I have a table that has a student's reading fluency scores. Students will be tested multiple times thruout the year and with no set schedule. (One student may be tested 2x a year, another weekly) So I need to get the most recent score for each student. I've been doing it using sub-queries (get max(test_date) for each student). But now I have a case where I need to do it w/o using subqueries. [code] SELECT studentID, @mtd:=MAX(test_date), MAX(IF(test_date = @mtd, score,0)) AS score, FROM reading_fluency AS rf WHERE test_date > '2006-09-01' GROUP BY studentID [/code] Doesn't work because @mtd ends up being set as the MAX of all students, not the student we are currently working with. BTW MAX(test_date) when run w/o assigning it to a variable DOES select the max for that student. [code] SELECT studentID, SUM(IF(test_date = MAX(test_date), score,0)) AS score, FROM reading_fluency AS rf WHERE test_date > '2006-09-01' GROUP BY studentID [/code] Doesn't work, I get "invalid use of group function" ... the MAX() inside the SUM() Can it be done?
-
Its called a "join" SELECT * FROM emp JOIN emp2 ON emp.passcode = emp2.passcode
-
SELECT * FROM whatever WHERE category = 'laptops' ORDER BY product_id
-
Ok, I guess I just didn't get the intent of the App Design forum from its subtitles. [quote]Just imagine how someone who thinks the is an "expert" would react to having his thread moved to N00bie Help.[/quote] LOL. I hadn't thought of that.
-
Give each column the same value 1,2,3,4 [code] function checkRadio() { var status = new Array(); var radObj = document.getElementsByTagName('INPUT'); //actuall gets all input elements not just radio for(var i=0; i<radObj.length; i++) { if(radObj[i].type == 'radio' && radObj[i].checked) { var colNum = radObj[i].value; if(status[colNum]) { alert('You cant select 2 in the same column'); return false; } else { status[colNum] = 1; } } } } [/code]
-
PHP is a server side technology so you can control if a radio button is selected when it is sent off to the user's browser. But you need to check if a button is selected after the user has fooled around with it, so you need javascript. <input type="radio" name="myRadioBtn" value="1" /> [code] function checkform() { for(var i=0; i<form1.myRadioBtn.length; i++) { if(form1.myRadioBtn[i].checked) { alert(form1.myRadioBtn[i].value); ...do something } } }[/code]
-
No not the application design forum because I think it should be for coding help too. And not the inner circle thing because a person with 30 posts may be an expert in the area you're having problems with. [quote]So we decided to try to tackle the most common/newbie problems/questions by having a code/faq forum and *hope* people would go there first, and if they can't find what they need, then ask. But even then that doesn't work all that well.[/quote] A lot of your users wont take the initiative to search the code/faq. If they had the initiative they could look it up in the manual instead of being spoon fed. And I think you'd see a big difference between having a "newbie forum"/"php help" and "php help"/"expert forum"
-
Ok, why not. I'm 34 years old, I have 6 kids. I live in Olympia, WA. I was a network engineer then IT director. Around 2001 I threw away my MCSE tie tacks and switched most of my servers to Linux and all of my home computers. I dabbled in PHP/web development until late 2004 when I began writing Intranet applications in my "spare" time. I enjoy solving puzzles so it really grew on me. So when the company I was working for went tits up last year, I took a Intranet developer job at a school district. So for the last year I've been doing PHP/SQL full time. I like motorcycles, fast cars, sports and the outdoors.
-
Can you have an entry for every x,y coordinate and then do something like [code] SELECT id, IF(occupied,x,'n') AS x_coord, IF(occupied,y,'n') AS y_coord [/code]
-
ORDER BY first, last
-
How about an "Expert" or "Advanced Topics" forum so we can exchange ideas or collaborate on difficult problems without it getting drown out in a sea of "how do you join two tables?" questions.
-
You typically wont submit to the opener. Just submit to the current window, then after any processing has been done you'll either refresh the opener or change something in the opener's dom to signify the change.