Hi Anybody there,

Incredibly greeeeeeeat ! Just see the script below to figure you out how MC is,
natively and without any XCMD, DLL or so on, able to connect any SQL database
server, using the Metatalk built-in "POST" command :-)

This script acts as an MySQL 3.22 front-end and use PHP to access to the
database (tested in using MC 2.31 under Linux/Apache/PHP3, Win98/Apache/PHP4,
WinNT4/Apache/PHP4, WinNT/IIS4/PHP4). For the existing SQL systems that don't
handle clean PHP connections, any other SQL querys scripting system can be used
in place of PHP, like ASP's to access MSSQL 6.x and 7, like Perl to connect MC
to an SQL system from MacOS8+.

It's working asynchronously under unix and, probably too, (not sure for yet)
under winnt. In replacing php by asp's, it will become full compatible with the
proprietary networks protocols used in the Microsoft world (pipes, etc...).

Just one more word : Metacard is lots more powerfull than tools like PHP, ASP's,
Perl and so on to build dynamic contents for VPN and Web apps. Please use it for
most of the job and just take advantage from PHP or ASP scripts as simple
datasources connectors, no more. In using 95% of Metatalk and 5% of non Metatalk
code, you will get, in just some hours, the best results you will ever get in
using any other vpn or web dedicaced development tool, like WebSphere, Oracle
WAS, Java or WebObjects solutions, in working along weeks !

To include to a cgi .mt script or an mc applications server app :

on QuerySQL
global Retour
post "a=b" to url "http://localhost/cndp/repsql.php" #or .asp or .pl or...
put "<HTML><HEAD>" & \
"<META HTTP-EQUIV='content-type' CONTENT='text/html;charset=iso-8859-1'>" & \
"<META NAME='generator' CONTENT='Metacard'>" & \
"<META NAME='keywords' CONTENT='metacard linux apache php mysql winnt mssql'>" &
\
"<TITLE>Connexion METACARD/MYSQL via IIS4/PHP</TITLE>" & \
"</HEAD><BODY bgcolor='white' text='darkblue' background=''>" & cr & \
it & cr & \ # it contains the "Post" reply result
"</BODY></HTML>" into Retour
end QuerySQL

store the php script below in the httpd docs folder as "repsql.php" :

<?
//$link = @mysql_pconnect ('localhost', 'admin', 'psa') or exit ();
$link = @mysql_pconnect ('localhost', '', '') or exit ();
mysql_select_db ('Citalis') or exit ();
$result = mysql_query ('SELECT COUNT(*) FROM Citations') or exit ();
if ($row = mysql_fetch_array ($result))
echo ('La base Citalis compte actuellement ' . $row[0] . ' auteurs !...');
else echo ('Comme un bug !');
mysql_free_result ($result);
?>

and, than, go head !

Thank's again and again to the Scott's Team !

Kind Regards, Pierre Sahores

chef de projet cyberlibrairie
SNPIN - CNDP. 91, rue Gabriel-Peri
92120 Montrouge. T�l.: 01.64.45.05.33

Penser la part du r�ve et
produire l'avantage comp�titif.

Archives: http://www.mail-archive.com/[email protected]/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to