[mapguide-users] ApacheMapguide and mysql

lolob azzam_wahab at hotmail.com
Thu Feb 7 23:36:48 EST 2008


Hello guys..

I have problem with my ApacheMapguide (Machine A) trying to connect to mysql
server (Machine B)..I created a simple "mysql_connect.php" file just to test
whether Machine A  can connect to Machine B..But when I browse the file
"http://localhost:8700/mapguide2008/mysql_connect.php", I got white blank
page..If mysql_connect.php failed, it's supposed to give me an error...but
it's nothing at all...I guess, it must have something to do with
ApacheMapguide itself..So, I downloaded XAMPP and installed it in Machine C
to test..I placed the same file (mysql_connect.php) and browsed it
(http://machine_c:80/mysql_connect.php)..the Machine C successfully
connected to mysql server (Machine B)..Does anyone know how to overcome
this?

Actually, I have 5 types of different Weblayout for five different
groups...I created a database in Machine B to hold user's username,password
and group...so when the 'user-1' login, it will be directly sent to
'Weblayout-1'...please look at my code below (basic idea of me)..Thanks


<?php
  if ($db = @mysql_connect('localhost', 'user', 'password')) {
    mysql_select_db('username', $db);
    $result = mysql_query('SELECT * FROM quotes', $db);
    while ($row = mysql_fetch_assoc($result)) 
    {
      $group = $row['group'];
    }
    mysql_close($db);
  } else {
    echo 'Connection failed';
  }
?>
<?php
    include 'utilityfunctions.php';

    MgInitializeWebTier($configFilePath);

	$site = new MgSite();
	$site->Open(new MgUserInformation('demo', 'demo'));

	$sessionId = $site->CreateSession();

        if($group == 'group1')
	     $webLayout = "Library://Group1.WebLayout";
        else if($group == 'group2')
	     $webLayout = "Library://Group2.WebLayout";
        else if($group == 'group3')
	     $webLayout = "Library://Group3.WebLayout";
        else if($group == 'group4')
	     $webLayout = "Library://Group4.WebLayout";
        else($group == 'group5')
	     $webLayout = "Library://Group5.WebLayout";
?>
<html>
<head>
    <title>TEST</title>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<frameset rows="0,*" frameborder="NO" border="0" framespacing="0">
    <frame src="title.html?AppName=AJAX" name="TitleFrame" scrolling="NO"
noresize>
    <frame src="../mapviewerphp/ajaxviewer.php?SESSION=<?php echo
$sessionId; ?>&WEBLAYOUT=<?php echo $webLayout; ?>" name="ViewerFrame">
</frameset>
</html>

-- 
View this message in context: http://www.nabble.com/ApacheMapguide-and-mysql-tp15349360s16610p15349360.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list