does anyone know how to connect to an access database via php? i'm an asp developer (sorry!) and php leaves me bog-eyed i'm afraid. this is the script that i've ended up with:
the image is being uploaded (from earlier in the script) and the echo reports a favourable sql insertion, but the database remains uninserted!! any ideas folks??
ralph
Code:
if(is_uploaded_file($_FILES['file']['tmp_name']) && $_SESSION['upload'] == "true")
{
move_uploaded_file($_FILES['file']['tmp_name'],$uploaddir.'/'.$_FILES['file']['name'].'.jpg');
$file = $_FILES['file']['name'];
$_SESSION['output'] = "Correct!";
$_SESSION['upload'] = "true";
$db = '..\..\db\isview.mdb';
$conn = new COM('ADODB.Connection');
$conn->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=$db");
$sql = "INSERT INTO e_cat (cat_code, cat_subcode) VALUES (".$icode.", ".$_FILES['file']['name'].")";
$conn->Execute($sql);
echo $sql;
$conn->Close();
}
ralph