Reply to SQLite3 and PHP

Your name:

Reply:


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!

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация