PHP Web Host - Quality Web Hosting For All PHP Applications Just Great Software
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
Donovan
Client


Joined: Oct 07, 2003
Posts: 675
Location: Ohio

PostPosted: Tue Jan 08, 2008 9:19 am Reply with quote Back to top

The DROP TABLE is not working. Anyone know why?

Code:
//Get the academic year
$Get_Academic_Year = $db->sql_query("SELECT Academic_Year FROM ".$prefix."_tl_config"); 
while ($info = $db->sql_fetchrow($Get_Academic_Year)) {
      $Academic_Year = $info['Academic_Year'];
      }

//Check valid Students UID's and compare to the imported table
$checkUID = $db->sql_query("SELECT a.StudentID FROM ".$prefix."_tl_session_grade_import a
LEFT JOIN ".$prefix."_tl_students b ON a.StudentID = b.U_Account
WHERE b.U_Account IS NULL");
//AND a.Session_ID = '$Session_ID'");
//WHERE a.Session_ID = '$Session_ID'");

$error_total = $db->sql_numrows($checkUID);
//We have unmatched UID's!
if ( $error_total > 0 ) {
OpenTable();
echo"<tr><td>There are errors in the IRAT imported table.  These need to be fixed before writing to the grades table.  Ensure all student UID's match for all current students already in the system.</td></tr>";
echo"<tr><td><input type=\"button\" value=\"Back\" onClick=\"history.go(-1)\"></td></tr>";
Closetable();
die();
} else {
//No errors detected so import IRAT grades from _tl_session_grade_import into _tl_session_grades table.

$sql = ("INSERT INTO ".$prefix."_tl_session_grades (Session_ID, SOMS_KEY, UID, Group_ID, IRAT_Grade)
(SELECT a.Session_ID, b.SOMS_KEY, a.StudentID, c.Group_ID, a.Total_Percent FROM ".$prefix."_tl_session_grade_import a
JOIN ".$prefix."_tl_students b ON (a.StudentID = b.U_Account)
JOIN ".$prefix."_tl_group_students c ON (b.SOMS_KEY = c.SOMS_KEY)
JOIN ".$prefix."_tl_session d
WHERE a.Session_ID = d.Session_ID)");
$result = $db->sql_query($sql);
if (!$result) {echo("<p>Error performing query: " . mysql_error() . "</p>");}
die();
//Get the academic year and update table
$Get_Academic_Year = $db->sql_query("UPDATE ".$prefix."_tl_session_grades SET Academic_Year = (SELECT Academic_Year FROM ".$prefix."_tl_config)");

//Drop Import table
$sql = "DROP TABLE IF EXISTS ".$prefix."_tl_session_grade_import";
$result = $db->sql_query($sql);   
if (!$result) {echo("<p>Error performing query: " . mysql_error() . "</p>");}
die();
     
//header("Location: ".$admin_file.".php?op=TLViewIratGrades&Session_ID=$Session_ID");
}
?>
View user's profile Send private message Visit poster's website ICQ Number
Gremmie
Moderator


Joined: Apr 06, 2006
Posts: 2356
Location: Iowa, USA

PostPosted: Tue Jan 08, 2008 11:33 am Reply with quote Back to top

What error does it give (what is printed out for mysql_error())? Have you tried to manually run the drop command in phpmyadmin to see?
View user's profile Send private message
Donovan
Client


Joined: Oct 07, 2003
Posts: 675
Location: Ohio

PostPosted: Tue Jan 08, 2008 12:44 pm Reply with quote Back to top

Nothing is displayed for the error. I have successfully run the command in phpmyadmin.
View user's profile Send private message Visit poster's website ICQ Number
Donovan
Client


Joined: Oct 07, 2003
Posts: 675
Location: Ohio

PostPosted: Tue Jan 08, 2008 1:01 pm Reply with quote Back to top

Disregard.. I fixed it.

Forgot to give the proper privileges to my user.

Embarassed
View user's profile Send private message Visit poster's website ICQ Number
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2008 by Raven
Proud to be listed at Lobo Links Web Directory

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::

:: fisubice Theme Recoded To 100% W3C CSS & HTML 4.01 Transitional Compliance by Raven and 64bitguy ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum