views:

30

answers:

1

something is seriously wrong with my SQLITE

I included echo $dbquery to see exactly what query is being run, and the statment seems correct - but when trying to view the db after, it comes up blank! I've checked the actuall file, and theres still data in the db file, so maybe it corrupting it?

the query prints as: DELETE FROM toolList WHERE toolId=1289

function Up($id){
global $dbhandle, $dbresult;
$dbquery = "DELETE FROM toolList WHERE toolId=".$id;
$dbresult = sqlite_query($dbhandle, $dbquery);
echo $dbquery;
}

< a href="'.Up($data['toolId']).'">DELETE!< /a>

Thanks

A: 

It is highly unlikely that you corrupted a sqlite db during normal operation. Your question is a bit unclear:

  • What happens if you run a select statement from the sqlite3 command line utility against your DB.
  • Keep in mind that sqlite does not shrink a DB file untill you issue a vaccum command.
  • Also it looks like you are running your function to display the href for the link, but the function does the delete! So if you ran this over a list of items once, then they would all be gone.
My Other Me