Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 758903
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:32:03+00:00 2026-05-14T15:32:03+00:00

mysql_connect(localhost,root,); mysql_select_db(hitnrunf_db); $result=mysql_query(select * from jos_users INTO OUTFILE ‘users.csv’ FIELDS ESCAPED BY ” TERMINATED

  • 0
mysql_connect("localhost","root","");
mysql_select_db("hitnrunf_db");

$result=mysql_query("select * from jos_users INTO OUTFILE 'users.csv' FIELDS ESCAPED BY '""' TERMINATED BY ',' ENCLOSED BY '"'
 LINES TERMINATED BY '\n' ");

header("Content-type:  text/plain");
header("Content-Disposition: attachment; filename=your_desired_name.xls");
header("Content-Transfer-Encoding: binary");
header("Pragma: no-cache");
header("Expires: 0");
print "$header\n$data";

in the above code in query string i.e string in side mysql_quey

we are getting following error

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\wamp\www\samples\mysql_excel\exel_outfile.php on line 8

in query string ‘\n’ charter is not identifying as string thats why above error getting

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T15:32:03+00:00Added an answer on May 14, 2026 at 3:32 pm

    You need to escape the double quote as: \" instead of ""

    $result=mysql_query("select * from jos_users INTO OUTFILE 'users.csv' FIELDS ESCAPED BY '\"' TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\n' ");
    

    An un-escaped " will prematurely terminate the string.

    Example:

    This is incorrect: "A " is a double quote"
    This is correct: "A \" is a double quote"

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am calculating one parameter(X) this way: <?php $link=mysql_connect(localhost,root,); mysql_select_db(hand); $result = mysql_query(select *
<?php $con = mysql_connect(localhost,root,); mysql_select_db(image, $con); if ($_SERVER['REQUEST_METHOD'] == 'POST') { $result = mysql_query(SELECT
<?php mysql_connect(localhost,root,); mysql_select_db('db2012'); $uid = 8; $mid = 10; $q = mysql_query(select friend from
<?php $con= mysql_connect(localhost,root,mysql); mysql_select_db(Db_name,$con); $res=mysql_query(select *from table_name); mysql_close($con); // closing connection before fetching contents.
<?php ini_set('display_errors', 0); $search = $_GET ['search']; mysql_connect(localhost, root, gokul); mysql_select_db(search123); $query = mysql_query(SELECT
Ok so i have a php script: <?php mysql_connect(localhost,root,root); mysql_select_db(FYP); $sql=mysql_query(select team_name, games_played, games_won,
<?php $objConnect = mysql_connect(localhost,,root) or die(mysql_error()); $objDB = mysql_select_db(mydb); $pic2 = SELECT * FROM
$objConnect = mysql_connect(localhost,root,) or die(mysql_error()); $objDB = mysql_select_db(Test); $strSQL = SELECT * FROM UserAddedRecord
$dbc = mysql_connect('localhost','root','') or die (mysql_error()); mysql_select_db('payroll') or die (mysql_error()); $sql = "SELECT *
$con = mysql_connect(localhost,root,); if (!$con) die('Could not connect: ' . mysql_error()); mysql_select_db(pilot, $con); $sql

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.