ファイルの場所を格納する配列、fliepath を定義するこのコードを作成しました。
include 'last_file.php'; // Include the function last_file
$last_file = last_file(); // assign to the function a variable and call the function last_file
// Connect to the database
include('connect_thesis.php');
// Defining an array, which has the three paths to the three different gps receivers
$file_path[0] = "/Applications/MAMP/htdocs/php_test/check/".$last_file[0];
//echo $file_path[0]; echo "<br>";
$file_path[1] = "/Applications/MAMP/htdocs/php_test/check2/".$last_file[1];
//echo $file_path[1]; echo "<br>";
$file_path[2] = "/Applications/MAMP/htdocs/php_test/check3/".$last_file[2];
//echo $file_path[2]; echo "<br>";
次に、$file_path[0] を入力として取得する insert() という関数を作成しました。
function insert($file_path){
$fh = fopen($file_path,'r') or die ("Could not open:".mysql_error()).......;
メインスクリプトから関数を次のように呼び出します。
insert($file_path[0]);
私はプログラミングが初めてで、基本的なものがどこかに欠けていると確信しています! 問題は、関数が実行されないことです!!! 手伝って頂けますか?ありがとう D.
関数に値を正しく渡さないと思います。エラーとして何も得られないからです!