I have a PHP file which will extract data from an RSS feed and insert it into a database. Usually I wrap each field with a custom function to replace quotes but no longer need it (because of a change in requirements). For some reason when I use the logic below I get an error "error oci_bind_by_name(): Invalid variable used for bind" but if I wrap each field in the custom function like this:
$guid = customfunction($item->guid);
it works, why?
Thank you
foreach($rss->channel->item as $item) {
print '<a href="'.$item->link.'">'.$item->title.'</a><br />';
$guid = $item->guid;
$title = $item->title;
$link = $item->link;
$pubDate = $item->pubDate;
$description = $item->description;
$content = $item->content;
$stid = oci_parse($spConn,"INSERT INTO table123
(sku, title, link, pubDate, field1, field2)
VALUES(:guid_bv, :title_bv, :link_bv, :pubDate_bv, :description_bv, :content_bv)");
oci_bind_by_name($stid, ":guid_bv", $guid);
oci_bind_by_name($stid, ":title_bv", $title);
oci_bind_by_name($stid, ":link_bv", $link);
oci_bind_by_name($stid, ":pubDate_bv", $pubDate);
oci_bind_by_name($stid, ":description_bv", $description);
oci_bind_by_name($stid, ":content_bv", $content);
oci_execute($stid);