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 8588607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:50:44+00:00 2026-06-11T22:50:44+00:00

I do the following in my php code : $q=SELECT * FROM {$table} where

  • 0

I do the following in my php code :

$q="SELECT * FROM {$table} where x;
$link = mysqli_connect("localhost", "test", "test","mytable");
$res = mysqli_query($link,$q);
 if($res)
   {
       $row = mysqli_fetch_assoc($res);
       header("Content-type: text/xml");
       header("Content-Disposition: attachment; filename=$name");
       echo $row['blob'];
   }

I can see that the data(xml file) that I uploaded into mysql does not have any leading spaces but when I run the above code 3 new lines and a space appear and the file is not well formed xml any more.
Any idea why the exact contents are not being read from the table?

  • 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-06-11T22:50:45+00:00Added an answer on June 11, 2026 at 10:50 pm

    Figured it out.A silly mistake.
    My open php tag started on line 3 column 2

    > <?php
    

    and that made the ‘echo’ starting from the same line (line 3 column 2).
    Is that how echo is supposed to work?

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

Sidebar

Related Questions

Little question: With the following code... <?php $statement = SELECT * FROM TABLE; $query_unfetched
I have the following PHP code doing a very simple select into a table.
I have the following PHP code: $data=mysql_query(SELECT * FROM notes WHERE rootNoteId='$noteId'); $mainArray; while($result
I am using the following code: $result = mysql_query(SELECT * FROM table LEFT JOIN
I have created a PHP code to echo the following div <div id=main_catsel> <select
I have the following jquery code: jQuery(function(){ jQuery(select#rooms).change(function(){ var options = ''; jQuery.getJSON(/admin/selection.php,{id: jQuery(this).val(),
Consider the following code: <?php $conn = mysql_connect('localhost', 'username', 'password'); mysql_select_db('database', $conn); ?> This
I've got the following php code printing out the contents of a SQL table.
i have a php code which selects and shows data from my 'elections' table.
I am trying to do the following... select all columns from the table hqfjt_chronoforms_data_addemailtemplate

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.