|
Posted by Jon on 04/23/07 19:11
Hi,
I'm having some trouble trying to get DELETE to work with SQLITE3 and
PHP and was wondering if anyone could be of some assistance?
I have verified that it is set up correctly and I'm able to insert /
create / select from tables but I'm unable to delete specific entries.
Given the following 2 tables:
Table A Table B
Name Cost Name Cost
A 1 D
3
B 2 E
5
C 3 F
7
how would I delete entries with the same cost?
my current code is:
<?php
function deleteRel($year) {
$db_file = "/../".$year.".sqlite3";
try{
$dbHandle = new PDO('sqlite:'.$_SERVER['DOCUMENT_ROOT'].$db_file);
}catch ( PDOException $exception ){
die($exception->getMessage());
}
$sqlDeleteVal = sprintf("DELETE table_1 FROM table_1, table_2 WHERE
table_1.cost = table_2.cost");
}
$year = 2010;
deleteRel($year);
?>
Please note that I do not wish to use UNIQUE since this is just a
simplification of what I am trying to achieve.
Thanks for your responses!
Navigation:
[Reply to this message]
|