mac,
yeah at present we are not using any username or password..but will be doing it soon...
telnet to your MySQL servers IP address and port number (normally 3306) to check that it is possible to do a remote connection and that firewalls or things ...
i cannot able to telnet...but i say that i can run that connection file from my system connecting to MysQL database in server(10.100.120.1)
so it means that i can connect to that server, is it not????
therz no firewall...
volka,
i used mysql_connect ( $host, $user, $password);
i hav used a third parameter true value...means that i can hav multiple connection...
at present no username and password, so in my program
i used
Code: Select all
<?php
$username='';
$password='';
?>
here goes the full code...i am getting Modules, then Lessons for that modules, then Slides for that Lesson then checking whether the slides were already accessed or not...(this checking is done with data from a table of another database...
Code: Select all
<?php
<?
$username = '';
$password = '';
$dbname_one = "mmlsdb";
$dbname_two = "Student_Monitor";
$connection_one = mysql_connect("10.100.120.1",$username,$password,true) or die ("Could not connect connection one");
$connection_two = mysql_connect("10.100.120.1",$username,$password,true) or die ("Could not connect connection two");
mysql_select_db($dbname_one,$connection_one);
mysql_select_db($dbname_two,$connection_two);
echo "<br><b>connection ok...</b></br>";
$strSpace = str_repeat("&nbsp;",4);
$sSQL = "SELECT * FROM Module WHERE CoordinatorID=1034387138 ORDER BY ModuleID";
$ModuleResult=mysql_query($sSQL,$connection_one);
$ModCount=1;
while($rsModule=mysql_fetch_array($ModuleResult))
{
$ModID = $rsModuleї"ModuleID"];
$ModTitle = $rsModuleї"ModuleTitle"];
$ModTitle = strtoupper($ModTitle);
echo "<br><font color=green><b>$ModCount.
ModTitle</b></font>";
$sSQL = "SELECT * FROM Chapter WHERE
CoordinatorID=1034387138 AND ModuleID=$ModID
ORDER BY ChapterID";
$LessonResult=mysql_query($sSQL,$connection_one);
$LessonCount=1;
while($rsLesson=mysql_fetch_array($LessonResult))
{
$LessonID = $rsLessonї"ChapterID"];
$LessonTitle = $rsLessonї"ChapterTitle"];
echo "<br><b>$strSpace $LessonCount. $LessonTitle</b>";
$sSQL = "SELECT * FROM Slide WHERE
CoordinatorID=1034387138 AND ChapterID=$LessonID AND ModuleID=$ModID ORDER BY Sequence";
$SlideResult=mysql_query($sSQL,$connection_one);
$SlideCount=1;
while($rsSlide=mysql_fetch_array($SlideResult))
{
$SlideID = $rsSlideї"SlideID"];
$SlideTitle = $rsSlideї"SlideTitle"];
echo "<br><b>$strSpace$strSpace $SlideCount. $SlideTitle</b>";
$sSQL = "SELECT * FROM demoreport WHERE SlideID=$SlideID";
$VisitedResult=mysql_query($sSQL,$connection_two);
while($rsVisited=mysql_fetch_array($VisitedResult))
{
$Visited=$rsVisitedї"Visited"];
}
if($Visited==0)
{
echo "<font size='2' color=red><b>$strSpace Not Visited</b></font>";
}
else
{
echo "<font size='2' color=blue><b>$strSpace Visited</b></font>";
}
$SlideCount++;
}//***END OF SLIDE LOOP
$LessonCount++;
}//***END OF LESSON LOOP
$ModCount++;
$LessonCount=1;
$SlideCount=1;
}//***END OF MODULE LOOP
?>
1. This file(call it as test.php) i put in my machine 'Shankar' web directory. I am running Apache webserver locally.. so in my web browser i typed '
http://localhost/test.php' . so it works fine...it displays the modules, lessons, slides (visited or not visited)...see that the MySQL database is in server 10.100.120.1 ...i am getting perfectly...
2. Now actually this prgram should be in our server(10.100.120.1)
So i uploaded this program(test.php).Apache is runin on server...
so i typed
http://10.100.120.1/test.php
herez the probs...i am not getting anything except
Could not connect connection one...