
mrherman
Members-
Posts
158 -
Joined
-
Last visited
Everything posted by mrherman
-
Well, that is not what I wanted to hear. Thank you very much!
-
Is it allowed for a user-defined variable to represent a table name? If so, could you give an example? I'm just getting errors, and can find no specific mention of this anywhere. The following gives an error: SET @mytable := 'table1' ; drop temporary table if exists temp_table ; create temporary table temp_table SELECT mycolumn from @mytable ; Thanks for any suggestions.
-
Is this considered correct syntax? (...the || ?) $result = mysql_query ( $sql ) || die ( __line__ . "_myquery_" . mysql_error() ) ; I'm confused...I thought the || and the "or" were perfectly interchangeable, but I had a query that wouldn't work (using the ||), and when I finally replaced the || with "or," it seemed to work. Thanks!
-
MySQL table cells look blank, but contain CHAR(13)
mrherman replied to mrherman's topic in MySQL Help
Thanks for your reply. -
I imported a CSV which had some blank cells. I tried to deal with the cells by using (for example) WHERE myfield = '' or myfield = ' ' I couldn't get anything to work, so I copied the contents of one of the cells and pasted it in a text editor. Come to find out, the cells contained CHAR(13) -- carriage returns. How did carriage returns get into the cells of the CSV? I generated the CSV from an EXCEL spreadsheet. Thanks!
-
I was thinking that OneNote might be a good snippet tool. Is there a PHP syntax coloring add-on package for OneNote? Thanks.
-
Yes, you are right...There are lots of loops-inside-of-loops and queries within loops. This is what I was was wondering was the culprit, especially since the first few hundred rows went relatively quickly. Thanks for the comments.
-
Hello, everyone -- I'm wondering why this is happening... I have a MySQL table of 1200 rows of students, in grades 9-12. They took a test, with differentiated questions for each grade level. Only one table is used, no joins, real simple. My PHP scoring program works ok. With one school of 300 test takers, the program requires about 1.5 minutes to score. When I add in 3 additional schools, it doesn't take 4 x 1.5 minutes to score -- it takes about 30 minutes! No school is "different" from another school. As it scores, it does the first several hundred rows quickly. But then it starts to slow down and then crawls, so that by the end of the scoring routine, it is scoring only 1 record per 2 - 4 seconds, it seems. Just looking for some insight on what is happening. Is it a memory-usage issue (computer has 6GB, running Win7). Thanks!
-
"Forcing" PHP to echo information as it executes
mrherman replied to mrherman's topic in PHP Coding Help
Ahaa! That is it! Thank you all for responding. Yes, that is it. One learns something new every day!! -
"Forcing" PHP to echo information as it executes
mrherman replied to mrherman's topic in PHP Coding Help
Thanks for your reply...I have tried to place an ECHO statement inside the WHILE loop, but it still waits until the end of processing and then prints out all the record numbers at one time, rather than doing it as it processes each record... -
Good evening -- My script takes a while to execute as it processes records from the db. I'd like to have it print out to the screen the record id # as it processess each record, just to let me know where it is. Currently, the program waits till the end and then prints out the record numbers, which is no help. How can I enable PHP to print out each record number as it goes along? Thanks!
-
Which is faster -- MYSQL SUM() or make PHP array and use array_sum()
mrherman replied to mrherman's topic in PHP Coding Help
Thank you!! -
Hello, everyone: I'm using PHP and Mysql. I've got a table of that has 30 fields that I need to add together. I've got to do this for each record, and there are about 10,000 records. Which would be more efficient? SELECT SUM( field1 + field2...) or to make an array for the fields and then use array_sum() Thanks.
-
Hi, In 3 columns of student information, I'd like to have 3 different counts. 1. students within classes (homeroom): 1...27, 1..19, 1..24, etc. 2. students within schools (school code): 1..332, 1..419, 1..289 3. students within district (district code): 1..3643 I can do the district count, but the others are beyond me. Thanks for any help!
-
Hi, samshel -- Thanks for your reply. In continuing to play with this "problem," I have realized my error...As the script moves on, I had a little piece of code in there that actually deleted certain parts of the table, which made it APPEAR that the UPDATE was not working, when actually it was working. Several hours! Sound of windshield washers: dumb-guy! dumb-guy! dumb-guy!
-
Thanks, arbitter -- The -- teamy.student_id -- is actually a table and a field, not a variable (table.field). Thanks for your reply, though.
-
Hi -- This query seems to be problematic because the UPDATE is not being performed. Could you please take a gander and let me know what is the problem? BTW, the table "teamy" does contain 630 records. Thanks in advance! $sql = "SELECT COUNT( * ) AS records FROM teamy" ; $result = mysql_query( $sql ) ; if ( ! $result ) { die ( __line__ . "_teamy_" . mysql_error() ) ; } $a_count = mysql_fetch_assoc($result); if ( $a_count['records'] = 0 ) { echo "No records found in teamy." ; } else { /*** Update r_rost_rma ***/ $sql = "UPDATE r_rost_rma JOIN teamy ON r_rost_rma.student_id = teamy.student_id SET r_rost_rma.teachername = teamy.team WHERE RTRIM( UPPER( r_rost_rma.localcourse ) ) = 'HOMEROOM'" ; $result = mysql_query ( $sql ) ; if ( ! $result ) { die ( __line__ . "_update_r_rost_rma_" . mysql_error() ) ; } }
-
Wow...Made to order! Thank you very much!
-
Hi In a SELECT statement, I need to fetch a last name from a field up to but not including the comma, if there is one in the field. The field I need to select from is 13 chars wide, and is in the following format: Johnson, John Smith, Suzy Valadovichici Marks, Markie So, some last names take up the entire 13-char field. What I need from the above is: Johnson Smith Valadovichici Marks Thanks for any help.
-
OK, thanks very much. That is all I know--no contextual code was given. I was thinking that perhaps the '$[[variable]]' was, by itself, a PHP structure. Will mark as solved.
-
Found this on Snipplr the other day. It looked interesting and was under the heading of "sticky nav." <?php if ( $[[variable]] == '[[value]]' ) { echo 'class="act"' ; } ?> Could someone explain this? Thanks.
-
Recommendations for file upload and distribution site -- ?
mrherman replied to mrherman's topic in Miscellaneous
Thank you for the suggestions. I'll check out Alfresco. Yeah, Sharepoint is in the district, but it is hated by everyone who is forced to depend on it. I couldn't bring myself to call it good. Cheers! -
Recommendations for file upload and distribution site -- ?
mrherman replied to mrherman's topic in Miscellaneous
I know what you mean, but they are not going to go with a proprietary site to contain student data. In case something happens to the data, they want to be able to blame a reputable entity, not the "guy who did a website for us," which would make them look like bad decision-makers. I'm thinking something like a modified Dropbox.