SitePoint Sponsor

User Tag List

Results 1 to 8 of 8

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jul 2000
    Location
    Odense - Denmark
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi!

    Ive have a webpage where I want to have dynamic generated images based on the contents of a MySQL database. How is this done?
    (I want to make some graphs on the users data in the database)

    Ive thought about makeing a Java-applet which generates the graphics, but it should also be possible to export the images(ex. to be used in a (argh!) word-document). But if you save the page in the browser, the images are lost, when they are applets, right?

    Ive also heard that you can create dynamic images with php. Is this usefull for my task?

    Thanks in advance!

  2. #2
    SitePoint Zealot HotDog's Avatar
    Join Date
    May 2000
    Location
    Salt Lake City, UT
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure I understand what exactly you mean. Do you want different images depending on the output of your DB? Is the DB output user determined, or page determined, or determined by other means?? Either way, two ways I can think of you can accomplish this is to either:

    A--setup your DB with an image category in the table with the information you are fetching and simply call the image with the rest of the data.
    B--use a simple IF/THEN statement to test for logical parameters to determine what image to load in different situations. Run your IF/THEN off the primary key of your outputted data.

    If I understand your question, either one of these will work in providing different images according to different DB output to the screen.
    If I'm missing your question just let me know and I'll try again.
    Joe Eliason
    Just a dog learnin' PHP from cat.

  3. #3
    SitePoint Member
    Join Date
    Jul 2000
    Location
    Odense - Denmark
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thats not exactly what i want. I really want the images to be dynamically generated. What i really want is to make some graphs depending on the users info in the database. Ill give an example:
    The user has the following in his DB(and this is something thats the user himself has typed in, not something that can be pre-determined):

    ("Denmark",30)
    ("Gearmany",20)
    ("USA",50)

    From this I want an image on my page that displays this nicely in a graph where on the y-axis there is the number, and on the x-axis there's the country.
    Just like you can do in a spreadsheet. Get it to print out nice images dependig on your data. It should be pretty easy to do with a Java-applet, but I really need to be able to export the images.
    Any ideas?

  4. #4
    SitePoint Zealot HotDog's Avatar
    Join Date
    May 2000
    Location
    Salt Lake City, UT
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    As far as the positoning goes, you can just use a simple javaScript/CSS script to positon the lable/number where ever you want on the page.

    As far as pasting everything to the image to make it one image, I have no idea how to do it dynamically. If you just want everything to be laid out in a spreadsheet type format, just input everything into a table. The table is then portable to other pages.

    Don't know if this helps. I know nothing about java applets so I can't give you any help there. So if that's the answer you are looking for, you'll need to ask a bigger dog than me.
    Joe Eliason
    Just a dog learnin' PHP from cat.

  5. #5
    SitePoint Addict kunal's Avatar
    Join Date
    Oct 2000
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is a very good article on this @ phpbuilder.com. Take a look at it.

    If you are looking for bar charts, you can do it simply using HTML.
    i dunno...

  6. #6
    SitePoint Member
    Join Date
    Jul 2000
    Location
    Odense - Denmark
    Posts
    24
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for you reply... And might I add:

    GODDAMN PHP IS COOL!!!!!


  7. #7
    SitePoint Zealot moshe_be's Avatar
    Join Date
    Dec 2000
    Posts
    169
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There are image modules for PHP that can generate dynamic images such as GD Library. But I am not sure how to use them. Look for existing scripts @ http://www.hotscripts.com/PHP/Script...hs_and_Charts/

    Or:
    http://www.hotscripts.com/PHP/Script..._Manipulation/

    Hope that helps.

  8. #8
    SitePoint Guru prequel's Avatar
    Join Date
    Nov 1999
    Location
    Brisbane, Australia
    Posts
    682
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i use www.imagefolio.com basic 2.2. right now but am testing some of the hotscript listed scripts such as this one here

    http://phpgraphy.sourceforge.net/


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •