+ Reply to Thread
Results 1 to 6 of 6

Thread: MYSQL New Tricker

  1. #1
    liguehs is offline x10Hosting Member liguehs is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    62

    MYSQL New Tricker

    Hi guys,

    I was wondering if some one can help me for making a new tricker like this one:
    http://www.nhl.com/

    Some changes I would like to have is that instead of having 3-4 news in the same picture, I would like to have only 1.

    But I am sure I would be able to acheive that, but my question is how can I make it so it reads the last let say the last 5 news from a mysql Database?

  2. #2
    diabolo's Avatar
    diabolo is offline Community Advocate diabolo is on a distinguished road
    Join Date
    Nov 2007
    Location
    Jersey Shore
    Posts
    1,683

    Re: MYSQL New Tricker

    well depending how your MySQL structure is set up, it can vary, and I cannot give you a definite answer until I see it. But here is a sample.

    $sql = "SELECT * FROM news ORDER id ASC|DESC LIMIT 0, 5"

    the main important things here is,
    ORDER
    `id` is how you are gonna track your news
    ASC|DESC = Ascending or Desecnding. chose one depending how your id's are calculated

    LIMIT
    `0` is the first one it starts at
    `5` is the last one it ends ad

    hope I was helpful
    Last edited by diabolo; 07-23-2009 at 04:19 PM.

  3. #3
    liguehs is offline x10Hosting Member liguehs is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    62

    Re: MYSQL New Tricker

    Hi,
    Thanks for your reply,

    Sorry if I was not clear, it is not the PHP/MYSQL it self, but a way of integrating the flash in it....


    Thats what is confusing me.

  4. #4
    diabolo's Avatar
    diabolo is offline Community Advocate diabolo is on a distinguished road
    Join Date
    Nov 2007
    Location
    Jersey Shore
    Posts
    1,683

    Re: MYSQL New Tricker

    o flash.
    well, sorry can't help you there. never really caught onto Flash and PHP interactions.

  5. #5
    liguehs is offline x10Hosting Member liguehs is an unknown quantity at this point
    Join Date
    Jul 2009
    Posts
    62

    Re: MYSQL New Tricker

    Up...

  6. #6
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: MYSQL New Tricker

    I'm more knowledgeable of Flex than Flash, but I can give you some pointers.

    You'll probably want to have the PHP script output the news items as XML. Some format like:
    Code:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <news>
      <item>
        <headline>Stix Nix Hick Pix</headline>
        <image>http://upload.wikimedia.org/wikipedia/commons/thumb/e/ee/Lange-MigrantMother.jpg/300px-Lange-MigrantMother.jpg</image>
        <caption>Migrant Mother</caption>
      </item>
      ...
    </news>
    When your widget gets the XML document, it fills in the news ticker with items based on the elements in the XML doc.

    With Flex, you can bind an HTTPService as the dataProvider for your widget, call "send" on the HTTPService and voila, you've got the data. I'm not as familiar with straight Flash, and I think it does it a little differently. I believe you use an XML object and call its load method (load in Flash CS3), passing in an HTTP URI. The load is asynchronous, so you'll have to add an "onLoad" handler to handle the response. Kirupa.com has an introduction to XML in Flash you might want to check out.

    The part I'm least certain about is creating the news item and ticker. That's where Flash and Flex differ the most.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

+ Reply to Thread

Similar Threads

  1. [PHP] MySQL and PHP
    By Bryon in forum Tutorials
    Replies: 43
    Last Post: 03-24-2011, 07:27 AM
  2. Which is better postgresql or MySQL?
    By Kurai Kumo in forum Scripts & 3rd Party Apps
    Replies: 11
    Last Post: 12-10-2009, 08:17 AM
  3. Replies: 14
    Last Post: 09-29-2008, 07:07 PM
  4. New Site-Suggestions?
    By mnoutside in forum Review My Site
    Replies: 9
    Last Post: 08-27-2008, 07:01 AM
  5. Have a problem with my forum
    By tikloos in forum Scripts & 3rd Party Apps
    Replies: 43
    Last Post: 01-19-2006, 01:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers