Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Required: pass information to the database #2

Open
ShreyaKapoor18 opened this issue Apr 6, 2022 · 2 comments
Open

Required: pass information to the database #2

ShreyaKapoor18 opened this issue Apr 6, 2022 · 2 comments

Comments

@ShreyaKapoor18
Copy link

$dbManager->setupDB();

This only creates two new tables but does not pass any information to the tables.
To do: insert statement that passes information to this table.

@ShreyaKapoor18
Copy link
Author

ShreyaKapoor18 commented Apr 7, 2022

This particular function is defined here:

private function writeToDataTable($conn) {
mysqli_select_db($conn, "schema_datastore");
$study = $_POST['study_id'];
$user = $_POST['user_id'];
$ind = $_POST['module_index'];
$platform = $_POST['platform'];
$sql = "INSERT INTO data (study_id, user_id, module_index, platform)
VALUES ('$study', '$user', '$ind', '$platform')";
if ($conn->query($sql) === TRUE)
return true;
return false;
}

It is then called here:

if ($insertData)
echo "Data has been inserted to the table";
else
echo "Error inserting data into the table";
$this->closeDB($conn);

This however doesn't work and I am not able to see where the echo messages are passed

@ShreyaKapoor18
Copy link
Author

Logs are stored in /opt/lampp/logs/php_error_log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant