Re: How to get data from AS400 to MySQL
I have installed mysql and Zendcore (PHP) on my AS400. I use this script
<?php
$ASdbname='127.0.0.1';
$ASdbuser='root';
$ASdbpwd='root';
$database='test';
$connessione = mysql_pconnect($ASdbname, $ASdbuser, $ASdbpwd) or die("Connessione non riuscita: " . mysql_error());
print("connection ok!");
//--------------------------------------------------------------------------------------
// CREAZIONE TABELLA, PRESUPPONE L'ESISTENZA DEL DATA BASE
//--------------------------------------------------------------------------------------
// $query = 'CREATE TABLE rubrica (nickname CHAR(40), email CHAR(80))';
// $ri = mysql_db_query($database, $query, $connessione );
// if (!$ri) {
// echo "<h1>Creazione della tabella fallita!".mysql_error()."</h1>";
//
// exit;
// } else {
// echo "<h1>Creazione della tabella riuscita.</h1>";
// }
mysql_select_db($database);
mysql_query("INSERT INTO rubrica (nickname,email) VALUES ('kossu','kossu@yahoo.it') ");
$query = "SELECT * FROM rubrica";
$risultato = mysql_query($query) or die("Query fallita");
print "<table>\n";
while ($linea = mysql_fetch_array($risultato, MYSQL_ASSOC)) {
print "\t<tr>\n";
foreach ($linea as $valore_colonna) {
print "\t\t<td>$valore_colonna</td>\n";
}
print "\t</tr>\n";
}
print "</table>\n";
/* Liberazione delle risorse del risultato */
mysql_free_result($risultato);
/* Chiusura della connessione */
mysql_close($connessione);
print("end script");
?>
Subject
Views
Written By
Posted
21250
November 03, 2004 05:22PM
11481
November 03, 2004 05:24PM
26172
November 04, 2004 03:25AM
14279
November 04, 2004 08:27AM
9415
May 14, 2008 08:37AM
9877
March 15, 2005 02:17PM
10208
June 24, 2005 05:10PM
9932
July 31, 2005 10:51PM
9906
August 02, 2005 10:32AM
11895
August 04, 2005 02:50AM
Re: How to get data from AS400 to MySQL
11314
September 02, 2006 02:34AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.