On 21 Jul 2017 at 07:33, Edmondo Borasio <[email protected]> wrote:
> I am updating a record of a SQLite database as follows:
>
> $db->exec('UPDATE Movies SET name = "new movie" WHERE ID="4"');
>
> but instead of using name and ID I want to use some variables, $NewItemName
> and $hId.
>
> Entering the variables as they are won't work. Neither using escape
> characters like \"$DbItemName\" and \"$hId\".
It would help if you said what language you are using.
In PHP, one could do this:
$db->exec ('UPDATE Movies SET name = \'' . $DbItemName . '\' WHERE ID=' .
$hId);
or perhaps:
$db->exec ("UPDATE Movies SET name = '$DbItemName' WHERE ID=$hId");
--
Cheers -- Tim
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users