how to assign table column to a variable
I would like to assign a column item to a variable to use in an export file. What's the syntax? The assignment below fails. It works if I only use text instead of $Orders.getColumnVal('OrderID').
<?php
$Orders = new WA_MySQLi_RS("Orders",$mydata,10);
$Orders->setQuery("SELECT orders.OrderID, orders.OrderDate, orders.IsGift, orderdetails.DetailName, orderdetails.DetailPrice, orderdetails.DetailQuantity FROM orders INNER JOIN orderdetails ON orders.OrderID = orderdetails.DetailOrderID ORDER BY orderdetails.DetailName ASC");
$Orders->execute();
?>
<?php
$OrderID = $Orders.getColumnVal('OrderID');
$OrderDate = "01/22/2024"; //$Orders.getColumnVal('OrderDate');
?>
<?php
$testfile = fopen("newfile.csv", "w") or die("Unable to open file!");
$txt = '"'.$OrderID.'","'.$OrderDate.'"';
fwrite($testfile, $txt);
fclose($testfile);
?>