$youdata = file_get_contents("data/data.txt");
$youdata = preg_replace('/\$(\w+)/e', '$GLOBALS["\\1"]', $youdata );
$youdata = mysql_real_escape_string("$youdata");
mysql_query("INSERT...... value ('$youdata')");
<?
$data = date("Ymd");
$youdata = file_get_contents("../txt/".$data.".txt");
$youdata = preg_replace('/\$(\w+)/e', '$GLOBALS["\\1"]', $youdata );
$youdata = mysql_real_escape_string("$youdata");
mysql_query("INSERT INTO board_test (name , detail) VALUES ('".$objArr[0]."','".$objArr[1]."')");
?>
ทำแบบนี้ไปค่ะ แล้ว error ค่ะ
Warning: file_get_contents(../txt/20130213.txt) [function.file-get-contents]: failed to open stream: No such file or directory in C:\xampp\htdocs\board\frm_get_file.php on line 3
Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\board\frm_get_file.php on line 5
Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in C:\xampp\htdocs\board\frm_get_file.php on line 5
Warning: mysql_query() [function.mysql-query]: Access denied for user 'ODBC'@'localhost' (using password: NO) in C:\xampp\htdocs\board\frm_get_file.php on line 6
Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in
C:\xampp\htdocs\board\frm_get_file.php on line 6
รบกวนช่วยดูให้หน่อยนะค่ะ