User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MySQL section within the Web Development category of DaniWeb, a massive community of 401,449 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,919 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Views: 1548 | Replies: 0
Reply
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  
Reply

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

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

 

Thread Tools Display Modes

Similar Threads
Other Threads in the MySQL Forum

All times are GMT -4. The time now is 1:10 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC