Domain Manage

need help

Discussion in 'New Domainers' started by chippyb, Aug 18, 2011.

Thread Status:
Not open for further replies.
  1. chippyb United Kingdom

    chippyb Active Member

    Joined:
    Jun 2011
    Posts:
    765
    Likes Received:
    7
    Hi Guys


    I need help with mysql really, i have 2 hotel sites up using a live url xml feed, its ok buts it slow and cant display all the data as it takes to long to load, so basicly can some explain to me either how to import my url xml feed into mysql and pull the data from mysql to my site or either import the csv file to my sql and pull the data down, i have tried and cant work it out at all, if someone could show me or teach me once that would be great for my future sites,
    Thanks
     
  2. Domain Forum

    Acorn Domains Elite Member

    Joined:
    1999
    Messages:
    Many
    Likes Received:
    Lots
     
  3. grantw United Kingdom

    grantw Well-Known Member

    Joined:
    Mar 2005
    Posts:
    4,649
    Likes Received:
    82
    If you post the code that isn't working someone may be able to tell you what's wrong with it. I doubt anyone is going to write the code out for you from scratch.

    Grant
     
  4. chippyb United Kingdom

    chippyb Active Member

    Joined:
    Jun 2011
    Posts:
    765
    Likes Received:
    7
    thats fine, well this is what i have so far and it works using the url live feed, but its very slow.

    <?php
    // specify url of xml file
    $url = "http://xmlfeed.laterooms.com/index.aspx?aid=*****&rtype=4&kword=milton+keynes";
    // get xml file contents
    $xml = simplexml_load_file($url);

    // begin new paragraph

    echo "<table width=\"100%\">";
    echo "<tr><th><strong>Hotel Name</strong></th>";
    echo "<th><strong>Accommodation Type</strong></th> ";
    echo "<th><strong>HotelStar</strong></th>" ;
    echo "<th><strong>Prices From</strong></th>";
    echo "<th><strong>View</strong></th></tr>";
    echo "</hr>";

    // loop begins
    $red = 1;
    foreach($xml->hotel as $hotel)

    {

    echo "<tr class='" . ($red?'red':'blue') . "'><td>";
    echo $hotel->hotel_name."</td><td>";
    echo $hotel->star_accomodation_type."</td><td>";
    echo $hotel->hotel_star."</td><td>";
    echo "&pound;".$hotel->prices_from."</td><td>";
    echo "<a href=".$hotel->hotel_link.">View Hotel</a>"."</td></tr>";

    $red = !$red;
    // end paragraph

    }
    echo "</table>";

    // loop ends

    ?>
     
  5. aquanuke

    aquanuke Well-Known Member

    Joined:
    May 2005
    Posts:
    2,019
    Likes Received:
    34
  6. chippyb United Kingdom

    chippyb Active Member

    Joined:
    Jun 2011
    Posts:
    765
    Likes Received:
    7
    Yea that what i dont know how to do or display it after this is what im after help for, is this something i need to offer money for?
     
  7. aquanuke

    aquanuke Well-Known Member

    Joined:
    May 2005
    Posts:
    2,019
    Likes Received:
    34
  8. grantw United Kingdom

    grantw Well-Known Member

    Joined:
    Mar 2005
    Posts:
    4,649
    Likes Received:
    82
    You need another php file based on the code you posted.

    The new file needs amending so that the data is inserted into the database rather than displayed with echos. You then setup a cron job to run this file once a day or whatever to automatically update the database.

    The existing file then needs amending to fetch the data from the database rather than the xml feed.

    To be honest, you seem to have no idea what you're doing, I'd suggest getting someone to do it from a freelance site, the basic coding will probably cost you £20.

    Grant
     
  9. seemly

    seemly Active Member

    Joined:
    Feb 2011
    Posts:
    973
    Likes Received:
    39
    for how much time you have invested in trying to do what you want to do, convert that into what you would charge as an hourly rate, I bet the time spent cost more than £50?

    Do yourself a favour and buy the wordpress solution from Anthony over at http://www.acorndomains.co.uk/services-wanted/90271-wts-laterooms-wordpress-solution.html

    It's a great kit and you may very well learn what is going on, whilst still having a site published within minutes.
     
  10. chippyb United Kingdom

    chippyb Active Member

    Joined:
    Jun 2011
    Posts:
    765
    Likes Received:
    7
    I really dont want to use someone else product like that wordpress, im quite happy using my design and not someone else's, im just trying to learn so I can make this easier for the future sites
     
  11. seemly

    seemly Active Member

    Joined:
    Feb 2011
    Posts:
    973
    Likes Received:
    39
    you don't have to use his design...
    Just change the CSS Anthony provides and make it your own...

    You have more chance of learning something by purchasing that theme and setting up a site on it and maybe make some money from your domains, whilst in the mean time looking at the code used which might help you to build your own solution.

    It sounds to me that you are a complete beginner at PHP, MYSQL and XML, and that's fine. But don't try and jump before you can walk. It's easy to develop a solution like Anthonys, but only when you know what you are doing.

    Why try and reinvent the wheel? It's there for the bargain price of £50.
     
  12. chippyb United Kingdom

    chippyb Active Member

    Joined:
    Jun 2011
    Posts:
    765
    Likes Received:
    7
    Haha yea it is cheap but i dont have £50 lol, buying a new car tomorrow so im wiped out at the mo!
    I am completely new to it, html css all fine but php and mysql no idea, everytime i search the net for it i only find things that are no good to me.
     
  13. AssetDomains United Kingdom

    AssetDomains Well-Known Member

    Joined:
    Feb 2010
    Posts:
    2,951
    Likes Received:
    52
    Thank you for the recommendation Chris.
    Chippy theirs plenty of code snippets out there to make your solution work google is your friend here.
    Some pointers from what I've learned putting together my theme.
    The live XML is not what you want to build your framework laterooms tell you as much. You either need the massive static XML or the csv file I'd recommend the later much more manageable.
    As for getting the data back out If your coding your own solution again your going to have to use google again to get examples.
    Have a look at http://www.w3schools.com/sql/default.asp maybe work through this section with there demo code.
    think again about wordpress or another cms millions of sites built around such frameworks for a reason they provide a great solid base to start from and are hugely customizable.
     
  14. chippyb United Kingdom

    chippyb Active Member

    Joined:
    Jun 2011
    Posts:
    765
    Likes Received:
    7
    for some reason very time I put the import the data into mysql from a csv file it either all goes into one coloum or all the coloums are empty? i thought as i was editing the data first that was the prob so i just used it as i got from laterooms and its the same problem
     
  15. AssetDomains United Kingdom

    AssetDomains Well-Known Member

    Joined:
    Feb 2010
    Posts:
    2,951
    Likes Received:
    52
    post your import code I'll have a look im far from expert in these matters I used a plugin to handel the import in my solution.
     
  16. chippyb United Kingdom

    chippyb Active Member

    Joined:
    Jun 2011
    Posts:
    765
    Likes Received:
    7
    im using the gui on my website host in myphpadmin
     
  17. seemly

    seemly Active Member

    Joined:
    Feb 2011
    Posts:
    973
    Likes Received:
    39
    This thread is genuinely painful to read...

    The code you put up earlier was not too far away from what you need to achieve. But rather than echo out onto the page, you need to store the results into variables, then inject that data into your database via an insert.

    The way I see it, you have a few options:
    1. Buy the Wordpress solution from Anthony for a bargain price of £50. and get a site up and running within 20 minutes
    2. Pay someone to build a solution for you and your requirements (which will cost a damn site more than Anthonys wordpress solution)
    3. Wait for someone who is beyond helpful and kind to do all the work for you for free.
    4. Learn at least the basics of PHP and MYSQL before trying to do anything else, as it's clear that the concepts are a little (a lot?) beyond you
    5. Don't bother
     
  18. AssetDomains United Kingdom

    AssetDomains Well-Known Member

    Joined:
    Feb 2010
    Posts:
    2,951
    Likes Received:
    52
    I just done a test of one of my csv's using the import tool in the phpmyadmin and it worked like a charm.
    The option csv selected automaticaly when i browsed to the file then I chose the option that said use header as colomn names.
    This was on a blank database with no tables created which i think makes a difference.
     
  19. chippyb United Kingdom

    chippyb Active Member

    Joined:
    Jun 2011
    Posts:
    765
    Likes Received:
    7
    hmmm im starting to think mine is different than yours?! as mine doesnt let me seem to do that, does yours have an upload file size limit, im having to cut mine down as it limits me to 8mb and well the file is 40mb and wont upload at that size,
    Im hosted by one.com, anyone else have that issue?

    Thanks for your help
     
  20. AssetDomains United Kingdom

    AssetDomains Well-Known Member

    Joined:
    Feb 2010
    Posts:
    2,951
    Likes Received:
    52
    Yes but mine is 105mb that shouldn't be an issue though you really don't need to upload the whole UK csv for most sites.
    For example the London site in your sig would only have the 700 or so hotels. Use excel to filter the city column for london etc copy the results and save as a new csv london.csv to upload make sure keep the header rows however so they can be used as your column headers in your database.
     
  21. chippyb United Kingdom

    chippyb Active Member

    Joined:
    Jun 2011
    Posts:
    765
    Likes Received:
    7
    yea I have tired that, this is what i meant mine doesnt have the same options as yours did,
    [​IMG]

    this is the problem im having im not trying to make it harder than it is
     
Thread Status:
Not open for further replies.

Share This Page