【发布时间】:2010-01-26 16:12:13
【问题描述】:
以下错误:
"警告:oci_execute() [function.oci 执行]:ORA-00911: 中的无效字符 F:\wamp\www\搜索引擎\test1.php 在第 69 行"
正在由此代码生成:
<?php
include_once('config.php');
$db = oci_new_connect(ORAUSER,ORAPASS,"localhost/XE");
$url_name = $_POST['textfield'];
$keyword_name = $_POST['textarea'];
$url_type = $_POST['RadioGroup1'];
$anchor_text = $_POST['textfield2'];
$description = $_POST['textarea2'];
$sql = "select seq_url1.nextval seq_url1 from dual";
$result = oci_parse($db,$sql);
oci_execute($result);
if($result)
{
while($row = oci_fetch_array($result))
{
$temp = $row['SEQ_URL1'];
echo $temp;
}
}
$sql_url1 = 'INSERT INTO URL1(Url_ID,Url_Name,url_Type,Anchor_Text,Dscription) '.'VALUES($temp,:url,:type,:anchor,:description)';
$compiled = oci_parse($db, $sql_url1);
oci_bind_by_name($compiled, ':url', $url_name);
oci_bind_by_name($compiled, ':type', $url_Type);
oci_bind_by_name($compiled, ':anchor', $anchor_text);
oci_bind_by_name($compiled, ':description', $description);
oci_execute($compiled);
?>
这可能是什么原因造成的?
【问题讨论】:
-
好吧,你能告诉我们无效字符以及查询被发送到数据库时的样子吗?
-
我不是 Oracle Guru,但是为什么在定义 $sql_url1 的字段和 VALUES 语句之间有一个句点?
-
@George - 在这种情况下,那个句点是 PHP 连接运算符......至于 为什么 它在那里,我也很好奇!