![]() |
|
|||||||
| Register | Projects | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| v3.1 Questions & Support Help and support for 68 Classifieds v3.1.x |
|
|
Thread Tools | Display Modes |
|
#1
|
||||
|
||||
|
I have the opportunity to do a bulk import of my site data to another company's site. And once I get this working, I will be importing his stuff into my site.
Is there a way to build a query to pull together all the products, product images and product fields for each ad into one result that I could export from mysql admin to excel? I would expect there to be many colums of data but each row would be all the data for each ad. I could sanitize it and export it for import on his end. Does this make sense? Has anyone done this before? Thanks gurus! |
|
#2
|
||||
|
||||
|
I have done some importing and exporting before and it really isn't all that fun.
![]() What I normally do is create a query to get the main listing data. Then inside the while loop do any additional queries to get the images, extra fields, etc.
__________________
Eric Barnes 68 Classifieds Developer Customer Area | Issue Tracker | Knowledge Base | User Manuals | My Blog |
|
#3
|
||||
|
||||
|
If you take a look at viewlisting.php you can see the queries that are made to retrieve all the data for a given ad.
__________________
Larry. |
|
#4
|
||||
|
||||
|
Here is what I would probably do:
PHP Code:
__________________
Eric Barnes 68 Classifieds Developer Customer Area | Issue Tracker | Knowledge Base | User Manuals | My Blog |
|
#5
|
||||
|
||||
|
B.Gordon, Erics code is php code, its a tan alone php file that within it contains mysql queries.
With 68C there are many different database tables, the owner info is in one, the ad info in another, extra field data in another and another for images.. The query you use will depend solely on what data you are looking to export.
__________________
Larry. |
|
#6
|
||||
|
||||
|
I am trying to get the following (I think I started down the right path in my Select above but went astray in all the joins):
User ID Username First Name Last Name E-Mail Address Telephone Number Ad ID Ad Category Name (so he can match this up with his categories which are slightly different) Ad Title Ad Price Ad Description Ad Extra Fields (make, model, year, color etc) ...all of them... Photo name that is ranked highest or ranked 5 if only one photo This stuff on a single row per ad would be exactly what I need... delimited with a tab (not comma since there are commas in the descriptions). It would be extra cool if I could strip HTML from the description when pulling it but I can do this sanitizing in excel if need be. Care to take a crack at it? I am willing to donate to the cause! I REALLY need this soon to give to this guy so he can import my data.
__________________
B.Gordon v.3.1.5 Developer www.canadaboatshopper.com Canada Boat Shopper - Boats For Sale By Owner In And Around Canada Last edited by bgordon : 10-16-2007 at 12:55 PM. |
|
#7
|
||||
|
||||
|
Create a new php file in your sites and include this:
PHP Code:
__________________
Eric Barnes 68 Classifieds Developer Customer Area | Issue Tracker | Knowledge Base | User Manuals | My Blog |
|
#8
|
||||
|
||||
|
Ok.. I got it working but it won't return NULL values from the extra fields. This means that my columns don't line up in excel where someone has not inserted a value into each and every field.
How can I get the query to return everything (nulls or empty included) for each record so my columns line up in excel? extra 1 | extra 2 |||extra5||extra7 instead of extra 1 | extra 2|extra 5 |extra7 You can see how this totally messes up an export.... we are almost there!!! Last edited by bgordon : 10-16-2007 at 10:27 PM. |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Installation Error | Maffo | v3.1 Questions & Support | 7 | 06-17-2007 11:34 AM |
| Data Truncated install error | mct2002 | v3.1 Questions & Support | 0 | 06-15-2007 04:44 PM |
| Quote for Data Import please | horseyard | v3.1 Questions & Support | 0 | 02-28-2007 07:37 PM |
| Data Import Problem on a Windows Server | sporthorsebreeder | Off Topic | 4 | 10-09-2006 08:49 AM |
| Data Base | build | v3.0 Questions & Support | 5 | 04-11-2006 08:50 AM |