|
 |
|
ถามเรื่อง CSV ครับ - คือผมทำการ Export CSV ครับ แต่ว่าในตัวแปลผมมีเครื่องหมาย , อยู่ด้วย |
|
 |
|
|
 |
 |
|
Code (PHP)
<?
echo "\"win\",\"thaicreate.com\"";
?>
|
 |
 |
 |
 |
Date :
2009-03-24 13:33:29 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ไม่เห็นได้เลยครับพี่น้องครับ
|
 |
 |
 |
 |
Date :
2009-03-24 14:04:43 |
By :
lermjunior |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
$A = 'Test, Wow';
echo $A'.','Fild2\n';
--------------------
คือในฟิลแรก ผมต้องการให้เครื่องหมาย , นั้นเข้าไปอยู่ในคอลัมแรกด้วยอ่ะครับ
|
 |
 |
 |
 |
Date :
2009-03-24 14:06:52 |
By :
lermjunior |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<?php
echo "\"$A\",\"$B\"";
?>
|
 |
 |
 |
 |
Date :
2009-03-24 14:28:07 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองศึกษาเพิ่มเติมเกี่ยวกับ PHP & CSV ครับ
|
 |
 |
 |
 |
Date :
2009-03-24 21:38:35 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
นอกจากนี้ยังสามารถเพิ่มข้อมูลผ่าน Ado/Odbcได้เช่นเดียวกันครับ
Code (PHP & CSV & Ado)
<html>
<head>
<title>ThaiCreate.Com PHP & COM (ADO)</title>
</head>
<body>
<?
$strConn = new COM("ADODB.Connection") or die("Cannot start ADO");
$strConn->Open("Driver={Microsoft Text Driver (*.txt; *.csv)};
Dbq=".realpath("csv/").";Extensions=asc,csv,tab,txt;");
$strSQL = "SELECT * FROM customer WHERE CustomerID = '".$_POST["txtCustomerID"]."' ";
$objRec = $strConn->Execute($strSQL);
if(!$objRec->EOF)
{
echo("CustomerID already exist.");
}
else
{
$strSQL = "";
$strSQL .= "INSERT INTO customer ";
$strSQL .= "(CustomerID,Name,Email,CountryCode,Budget,Used) ";
$strSQL .= "VALUES ";
$strSQL .= "('".$_POST["txtCustomerID"]."','".$_POST["txtName"]."','".$_POST["txtEmail"]."' ";
$strSQL .= ",'".$_POST["txtCountryCode"]."','".$_POST["txtBudget"]."','".$_POST["txtUsed"]."') ";
$flgSave = $strConn->Execute($strSQL);
If($flgSave)
{
echo("Save Done.");
}
else
{
echo("Error Save");
}
}
$objRec->Close();
$strConn->Close();
$strConn = null;
?>
</body>
</html>
|
 |
 |
 |
 |
Date :
2009-03-24 21:43:45 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|