Jump to content

alexmahone

New Members
  • Posts

    4
  • Joined

  • Last visited

alexmahone's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. The below code is not stamping the table rows to CSV, I get empty CSV download file.. pls help <?php $conn = oci_connect('uid', 'pass', '(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=hostname)(PORT=1521))(CONNECT_DATA=(SID=database)))'); if (!$conn) { $e = oci_error(); echo("<br/>".$e); trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR); } $stid = oci_parse($conn, 'SELECT server,ipaddress FROM table where rownum<=50 order by kill_time desc '); if (!$stid) { $e = oci_error($conn); echo($e); trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR); } // Perform the logic of the query $r = oci_execute($stid); if (!$r) { $e = oci_error($stid); trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR); } // Fetch the results of the query $ncols = oci_num_fields($stid); echo "<tr>\n"; for ($i = 1; $i <= $ncols; ++$i) { $colname = oci_field_name($stid, $i); } // Query Database $filename = 'file.csv'; $out = ''; // fiels to export $out .='server, ipadress'; $out .="\n"; // Add all values in the table while ($l = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) { for ($i = 0; $i < 2; $i++) { $out .=''.$l["$i"].','; } $out .="\n"; } // Output to browser with appropriate mime type header("Content-type: text/x-csv"); header("Content-Disposition: attachment; filename=$filename"); echo $out; exit; ?>
  2. im stuck in putting the records into grid view ... i'm looking for a code snippet.. thank u
  3. Hi , I have "testdb.s3db" sqlite database in the project folder.. I have created few records in a table also, I'm stuck in retrieving the records in GridView .. I need your kind attention want a solution asap .. ..
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.