【发布时间】:2015-08-20 07:50:51
【问题描述】:
如何将我的 PHP/Mysql 代码转换为 PHP/Oracle。 这是我的代码。
$query = "SELECT name FROM employee WHERE name = '".$userName."' and email = '".$userMobile."' and salary = '".$userSalary."' and deductions = '".$userDeductions."'";
$sql = mysql_query($query);
$recResult = mysql_fetch_array($sql);
$existName = $recResult["name"];
if($existName=="") {
$insertTable= mysql_query("insert into employee (name, email, salary, deductions) values('".$userName."', '".$userMobile."', '".$userSalary."', '".$userDeductions."');");
【问题讨论】:
-
需要转换什么?对我来说看起来像标准 SQL。但是,如果
salary和deductions是数字类型,则需要删除值周围的引号。 -
即使是数字 oracle 也不介意用引号括起来。但是,如果 $userDeductions 中的值有任何格式标记,情况就会不同
标签: php