SunQuest
 
           PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old December 30th, 2003, 02:24 AM
v_rajendra v_rajendra is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 1 v_rajendra User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to v_rajendra
Question Parse error: parse error in /home/tcprj/tcprj/www/php/qa_team_1.php on line 63

HI I'm getting a parse error when calling the following php script.

I am new to php and any help will be greatly appreciated.

Thanks in advance

<?

$project_id_v = $_REQUEST['project_name'];
$team_lead_v = $_REQUEST['team_lead'];
$engineers_v = $_REQUEST['engineers'];
$this_week_tasks_completed_v = $_REQUEST['this_week_tasks_completed'];
$this_week_tasks_in_progress_v = $_REQUEST['this_week_tasks_in_progress'];
$new_tasks_next_week_v = $_REQUEST['new_tasks_next_week'];
$week_start_date_v = $_REQUEST['week_start_date'];
$week_end_date_v = $_REQUEST['week_end_date'];
?>

<?php
/* Mapping Project name to project id based on the list selection*/

$db_connect = mysql_connect("localhost", "qateam", "qateam999")
or die("Could not connect");

mysql_select_db("qa_team_status") or die("Could not select database");

/* Insert record */

$sqlstmt = "INSERT INTO weekly_project_status_t (project_id,team_lead,engineers,this_week_tasks_co mpleted,this_week_tasks_in_progress,new_tasks_next _week,week_start_date,week_end_date) values ('$project_id_v','$team_lead_v','$engineers_v','$t his_week_tasks_completed_v','$this_week_tasks_in_p rogress_v','$new_tasks_next_week_v', '$week_start_date_v','$week_end_date_v')";
/* Performing SQL query $result = mysql_query($sqlstmt) or die ("Insert Failed");*/

/* porting data into the excel sheet */

$result = mysql_query('select * from weekly_project_status_t', $db_connect);
$count = mysql_num_fields($result);

for ($i = 0; $i < $count; $i++){
$title1 .= mysql_field_name($result, $i)."\t";
}

while($row = mysql_fetch_row($result)){
$line = '';
foreach($row as $value){
if(!isset($value) || $value == ""){
$value = "\t";
}else{
# important to escape any quotes to preserve them in the data.
$value = str_replace('"', '""', $value);
# needed to encapsulate data in quotes because some data might be multi line.
# the good news is that numbers remain numbers in Excel even though quoted.
$value = '"' . $value . '"' . "\t";
}
$line .= $value;
}
$data .= trim($line)."\n";
}
# this line is needed because returns embedded in the data have "\r"
# and this looks like a "box character" in Excel
$data = str_replace("\r", "", $data);

# Nice to let someone know that the search came up empty.
# Otherwise only the column name headers will be output to Excel.
if ($data == "") {
$data = "\nno matching records found\n";
}


# This line will stream the file to the user rather than spray it across the screen
<?php

header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=excelfile.xls");
header("Pragma: no-cache");
header("Expires: 0");
print "$title1."\n".$data";

?>

/* echo $title1."\n".$data; */

/* Closing connection */
mysql_close($db_connect);
?>

Reply With Quote
  #2  
Old December 30th, 2003, 07:39 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Can you maybe single out which line is 63 so we don't have to read the whole file or count lines?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > Parse error: parse error in /home/tcprj/tcprj/www/php/qa_team_1.php on line 63


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway