this code worked fine with php4 but my friend recently installed php5 and now its not working.
$form_data1=$_FILES['form_data1']['tmp_name'];
$event=$_POST['event'];
$points=$_POST['points'];
$date=$_POST['date'];
$test='';
$test1='';
$test2='';
$fcontents = file ("$form_data1");
for($i=0; $i<sizeof($fcontents); $i++) {
$line = trim($fcontents[$i]);
$arr = explode("\t", $line);
$name=$arr[1];
$number=$arr[0];
$junk=$arr[2];
$junk2=$arr[3];
$junk3=$arr[4];
$sql = "insert into Attendance values ('$number','$name','$junk','$junk2','$junk3','$test','$test1','$test2')";
mysql_query($sql);
echo $sql ."<br>\n";
if(mysql_error()) {
echo mysql_error() ."<br>\n";
}
}
Basically nothing gets entered into the table. Thsi may also be a mysql issue as he recently upgraded mysql from 4.1 to 5.Well you have "echo $sql" in your code. Does that give you valid sql? And if it does, whats the mysql error?Thats the issue it doesnt give an error.Try adding the following to the start of the script to see if you're missing any error messages:
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
$form_data1=$_FILES['form_data1']['tmp_name'];
$event=$_POST['event'];
$points=$_POST['points'];
$date=$_POST['date'];
$test='';
$test1='';
$test2='';
$fcontents = file ("$form_data1");
for($i=0; $i<sizeof($fcontents); $i++) {
$line = trim($fcontents[$i]);
$arr = explode("\t", $line);
$name=$arr[1];
$number=$arr[0];
$junk=$arr[2];
$junk2=$arr[3];
$junk3=$arr[4];
$sql = "insert into Attendance values ('$number','$name','$junk','$junk2','$junk3','$test','$test1','$test2')";
mysql_query($sql);
echo $sql ."<br>\n";
if(mysql_error()) {
echo mysql_error() ."<br>\n";
}
}
Basically nothing gets entered into the table. Thsi may also be a mysql issue as he recently upgraded mysql from 4.1 to 5.Well you have "echo $sql" in your code. Does that give you valid sql? And if it does, whats the mysql error?Thats the issue it doesnt give an error.Try adding the following to the start of the script to see if you're missing any error messages:
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);