The previous answers have been horribly complex for the scope of this project.
I want to take the $_POST
result as a variable and insert it into a BYTEA
field of a table.
$_SESSION['username'] = $username;
$file = $_POST["file"];
file is the file itself submitted from the form on the previous page
pg_prepare($conn, "register_user_info", 'INSERT INTO fileDB.assignment(pawprint, name, number, section, file) VALUES ($1, $2, $3, $4, $5)');
pg_execute($conn, "register_user_info", array($username, "1", "1", "1", $file));
I need to insert the file itself into the file column of my database. How can I make this happen?
psql
, the command-line client for PostgreSQL. – Craig Ringer Apr 15 '14 at 12:47