Jump to content

dd_gamer

Members
  • Posts

    37
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dd_gamer's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. OK... I guess I'm "NOT" smarter than a 5th grader... but thanks for the help...
  2. I have an issue that needs to be corrected by can't figure the math part. The current code charges 50% but I need to change it to charge 60%... the issue is that the math is using "/2" to get the 50% so how do I change to 60%? The current code : // If shipping method is ground we only want to change half. if ($this->shipn[$num]=="Ground") $return[$num][rate]=$return[$num][rate]/2; return $return; }
  3. Yes, thank you! I'm sorry but I don't understand how to use this method. Could you show an example with my code?
  4. I made the changes to my code using the "Group by" with the student_id and that makes the query run "all" students (600 plus). The server timed out after 2 minutes (see above)... So, back to my original question about table reduction methods. Does anyone have any idea's? I'm stuck on this at this time !
  5. I changed the schedules.gf to SUM(schedules.gf) but the aggregate counts every value within the date range and doesn't seem to recognize the "DISTINCT" in my code DISTINCT DATE(studentrecord_daily.record_date) so the count is too high (not correct). Also when I removed the student_id and use it in the Group by the query "error" time -out"
  6. Just to clear up any query issues ... here is the query: SELECT DISTINCT DATE(studentrecord_daily.record_date), studentrecord_daily.student_id, schedule_room.scheduledate, schedule_room.scheduleid, schedules.id, schedules.gf, schedules.schedule_desc FROM schedule_room JOIN schedules ON schedules.id = schedule_room.scheduleid JOIN studentrecord_daily ON DATE(studentrecord_daily.record_date ) = schedule_room.scheduledate WHERE studentrecord_daily.student_id = '3' AND studentrecord_daily.record_date >= '2011-09-06' AND studentrecord_daily.record_date <= '2011-11-04' And here is the loop: do { $factorSum =$row_rs_factor['schedules.gf']; $factorTotal = $factorTotal + $factorSum ; } while ($row_rs_factor = mysql_fetch_assoc($rs_factor)); Then upload: mysql_query("UPDATE tcstudent SET data = '$factorTotal' WHERE id = $student_id ");
  7. I don't have the code to get all the students yet! The code will look for "all students" that are active and run... If you look at the link you will see the code for one student only. If you do the math (600 x 2 seconds) the query will take to long and as time goes on the query will take longer and longer as the table keeps growing. That's why I'm asking for other methods , idea's and the possibilities.
  8. Maybe I confused the issue... here is the query from another post http://www.phpfreaks.com/forums/index.php?topic=352184.msg1662997#msg1662997 The above query is for "1" person but when I do the query for "all" students it will run 600 times...
  9. The query only takes approx. 2 seconds and was improved from 90 seconds on another post a few weeks ago. I have to run that query over 600 times (one per person) during the running of the report. I don't need the other (800,000) records during the report running and the table will be growing at a rate of 250,000 every 3 months or so. I hope this helps to explain my issue.
  10. Can you give an example of php code? I've never used cron and not sure if I have access...
  11. I'm hoping someone can help me or at least put me in the right direction. I have a Mysql database and one table with over 800,000 records. Most of the other tables are manageable. What I need to do is move a selected number of records (date range) from that one database table and make another table so I can improved my search capabilities within a report query. The majority of the 800,000 records are for reference only and only the active records need to be searched (approx. 20,000). I need all the records (800,000) for report history but not for the active query and the table will keep growing. Not sure if I should move table to another database! It would be best if I could automate a the process....
  12. GOT IT! Thank you all... just used the mysql_real_escape_string($stud_book) Before the insert code...
  13. When I used the above code this error message : With error: FUNCTION mydatabase.mysql_real_escape_string does not exist
  14. Thank you... can you give an example using my code if possible. I'm a little confused from the example you gave as to the correct syntax for my use.
  15. Thank you....the error message is below: INSERT failed: INSERT INTO rc_subjects (report_card_id ,student_id, subject_id, report_card_column_1, report_card_column_2 , created_on ) VALUES ('6', '21', '11', 'America's Story 1998', '1','February 28, 2012, 8:23 am' ) With error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's 1998', '1','February 28, 2012, 8:23 am' )' at line 1 Does this mean the 's in America's is causing a problem? If so how do I get it?
×
×
  • 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.