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!
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.:)
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):
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.
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.:)
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.
Thanks for you reply... And might I add:
GODDAMN PHP IS COOL!!!!!
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/
Hope that helps.
i use www.imagefolio.com basic 2.2. right now but am testing some of the hotscript listed scripts such as this one here