PHP头条
热点:

将OICQ数据转成MYSQL数据


This file is /tmp/phpBeoJQ5 .
################# You can copy this code to test #################
 
<?
include("include/dbclass.inc"); //可以用 MYSQL.INC 类代替测试
$q = new DB_Sql;
$db = $q->Database; //define the database
mysql_connect('localhost:3306',$q->User,$q->Password);
?>
<form method="post" action="<?php echo $PHP_SELF;?>"
enctype="multipart/form-data">
<input type="file" name="csv_file"
value="<?php echo $csv_file;?>">
terminated by <input type="text" name="terminated"
value="," size=2><p>
Which table you want to insert ?
<?php show_table($db,$table); ?><p>
<input type="submit" name="submit" value="go">
</form>
<?php
function show_field($db,$table,$num,$selected_field) {
$result = mysql_db_query($db, "SHOW KEYS FROM $table") or mysql_die();
$primary = "";
while ($row = mysql_fetch_array($result))
if ($row["Key_name"] == "PRIMARY")
$primary .= "$row[Column_name], ";
$result = mysql_db_query($db, "SHOW FIELDS FROM $table");
if (!$result) {
mysql_die();
}
else {
echo "<select name=field$num>n";
while ($row= mysql_fetch_array($result)) {
$selected = ($selected_field == $row["Field"]) ? "selected" : "";
echo "<option value=" . $row["Field"] . " $selected>" .
$row["Field"] . "</option>n";
}
echo "</select>nn";
}
}
function show_table($db,$selected_table) {
$tables = mysql_list_tables($db);
$num_tables = @mysql_numrows($tables);

www.phpzy.comtrue/php/15420.htmlTechArticle将OICQ数据转成MYSQL数据 This file is /tmp/phpBeoJQ5 . ################# You can copy this code to test ################# ? include(include/dbclass.inc); //可以用 MYSQL.INC 类代替测试 $q = new DB_Sql; $db = $q-Database; //defi...

相关文章

    暂无相关文章
相关频道:

PHP之友评论

今天推荐