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

  • SEARCH
  • Home
  • 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 8517881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:49:42+00:00 2026-06-11T05:49:42+00:00

OK, I’ll try and make this as easy to follow as I can! Background:

  • 0

OK, I’ll try and make this as easy to follow as I can!

Background: I’m creating an XML feed to display cars on ebay motors pro from a MySql database using php. I have successfully created the xml file with all the relevant details, which also ftp’s to my test server.

Problem: Each car photo is logged in the database as regnumber_1.jpg, regnumber_2.jpg; and so on, and linked to each vehicle. The images reside in a folder called autotrader.

I’m having trouble posting the images from the autotrader folder into the ebay folder within a zip file. I only want to copy the photos from the mysql query (i.e. not the entire folder).

I suspect it’s because I haven’t done the foreach loop correctly, but hopefully someone will be able to point me in the right direction? Here’s the code:

//Photos bit...
$destination = 'tmp/ebay';
$filename = 'ebay-photos';

//images array
$row = array();
foreach ($result->images as $images) {
$images = explode(',', $row['images']);
foreach ( $images as $image ) {
copy('uploads/used-cars/autotrader/' . $image, $destination . $image);
$all_images[] = $image;
}
}

exec('zip  -g0 ' . $zip_filename . ' *.jpg *.jpeg');
foreach ( $all_images as $image ) {
@unlink($destination.$image);
}
$zip_filename = $filename . '.zip'; 

while ($row = @mysql_fetch_assoc($result)){  
$all_images->images as $images);
} 

The XML bit works, and is:

while ($row = @mysql_fetch_assoc($result)){  
// XML  
$node = $dom->createElement("ad");  
$newnode = $parnode->appendChild($node);   
$newnode->setAttribute("vrm",$row['vrm']);
$newnode->setAttribute("make",$row['make']);
$newnode->setAttribute("model",$row['model']);
$newnode->setAttribute("type",$row['type']);
$newnode->setAttribute("consumerPrice",$row['consumerPrice']);
$newnode->setAttribute("numPreviousOwners",$row['numPreviousOwners']);
$newnode->setAttribute("transmission",$row['transmission']);
$newnode->setAttribute("images",$row['images']);
$newnode->setAttribute("numPreviousOwners",$row['numPreviousOwners']);
$newnode->setAttribute("color",$row['color']);
} 

$dom->save('tmp/ebay/ebay.xml');
echo $dom->saveXML();

Thanks in advance!

  • 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-11T05:49:43+00:00Added an answer on June 11, 2026 at 5:49 am

    I’ve created a separate php file to retrieve the photos and then ftp the zip file.

    This can now be closed.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am trying to understand how to use SyndicationItem to display feed which is
this is what i have right now Drawing an RSS feed into the php,
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
In my XML file chapters tag has more chapter tag.i need to display chapters
Does anyone know how can I replace this 2 symbol below from the string
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.