Tuesday, 4 September 2018
Subscribe to:
Post Comments (Atom)
<?php
require_once("settings.php");
$conn = oci_connect($db_user, $db_pass, $db_ip.'/'.$db);
if (!$conn) {
$e = oci_error();
trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
?>
<?php
require_once("connection.php");
function GetInvoice($n)
// returns invoice number for given order number
{
$stid = oci_parse($conn, 'SELECT InvoiceNo FROM Orders WHERE OrderNo = $n');
oci_define_by_name($stid, 'InvoiceNo', $InvoiceNo);
oci_execute($stid);
echo "$InvoiceNo";
}
GetInvoice(999645);
?>
InvoiceNo
, it is just not working in PHP.$conn
is undefined. Also, you have used $InvoiceNo
withoud fetch result, I did some refoctoring on that place. You can use following;function GetInvoice($n, $conn)
// returns invoice number for given order number
{
$stid = oci_parse($conn, 'SELECT InvoiceNo FROM Orders WHERE OrderNo = $n');
oci_define_by_name($stid, 'InvoiceNo', $InvoiceNo);
oci_execute($stid);
while (oci_fetch($stid)) {
echo "$InvoiceNo";
}
}
GetInvoice(999645, $conn);
Hello Friends! I am Ramana a part time blogger from Hyderabad.
0 comments:
Post a Comment