RSS Forums RSS
Please support our MySQL advertiser: Programming Forums
Views: 1681 | Replies: 0
Join Date: Apr 2006
Posts: 4
Reputation: arsmizzou is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
arsmizzou arsmizzou is offline Offline
Newbie Poster

changing my php sql code to oracle

  #1  
Apr 18th, 2006
can anyone help? thanks!

<?php
include_once "mysql_connect.php";

mysql_connection($dbc);

$select = "SELECT DISTINCT D.Title, D.FirstName, D.MiddleI, D.LastName, D.Suffix, D.Address1, D.Address2, D.City, D.State, D.Zip FROM Donor D, Pre_award P, sch_donor S WHERE Approved = 'y' AND S.Did = D.Did AND S.Scholarship_id = P.Scholarship_id";

$export = mysql_query($select);
$fields = mysql_num_fields($export);

for ($i = 0; $i < $fields; $i++) {
$header .= mysql_field_name($export, $i) . "\t";
}

while($row = mysql_fetch_row($export)) {
$line = '';
foreach($row as $value) {
if ((!isset($value)) OR ($value == "")) {
$value = "\t";
} else {
$value = strtolower($value);
$value = ucwords($value);
$value = str_replace('"', '""', $value);
$value = '"' . $value . '"' . "\t";
}
$line .= $value;
}
$data .= trim($line)."\n";
}

$data = str_replace("\r","",$data);

if ($data == "") {
$data = "\n(0) Records Found!\n";
}

header("Content-type: application/x-msdownload");
header("Content-Disposition: attachment; filename=./export/recipient_env.xls");
header("Pragma:");
header("Expires: 0");
print "$header\n$data";

//echo $header."<br><br>".$data;

?>
AddThis Social Bookmark Button
Reply With Quote  

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 2:12 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC