Reputation: 37
I have a problem with an online study I'm conducting, which is structured as a multi-page form. A processing file sends the data from each page to the database and assigns a unique ID based on user IP addresses. Subsequent pages use separate processing files and retrieve the ID from the first table by matching the IP address with the unique ID, using this php code:
$result = mysql_query("SELECT * FROM $table0 WHERE IP='$ipstr'");
$row = mysql_fetch_array( $result );
$id = $row['ID'];
I got a group of students to do the survey in a campus computer lab, but little did I realise, that all the computers were on one IP address. Consequently, a whole lot of valuable data did not get stored to the database.
While I've learned an important lesson about campus networking and the embarrassing implications of neglecting to consider the possibility of shared IP addresses in my code, I thought I should ask if there is any way to retrieve the data from the form submits that weren't inserted into the database. Any ideas?
Upvotes: 1
Views: 71
Reputation: 11830
As of now you cannot do anything as it is lost. But in future you can use logs. you can retrieve your data if you create logs for form submitted data. You can then check this apache logs for each submitted form data and put a log for the sql results if it was successful you do not need to worry but if the query failed you can read that data from logs.
Upvotes: 0