Log in

View Full Version : voting system



imi_99
01-11-2007, 12:55 AM
I want to create voting system on my website. how can i implement it. the logic is if i create some voting system in mysql table and save result in mysql. how can i show that result in graph shape in such a way like

e.g voting are on five things,

animal 5 bird 30 fish 30 cars 15 and homes 25 votes
total vote cast 105


how can i show this in graph.

I want to show like

for animal it shows green bar

bird shows red bar

etc.

hope you will understand the question. any query please feel free to email me.

any idea how can i get my objective. thanks

imi

djr33
01-11-2007, 06:51 AM
http://php-mysql-tutorial.com

Is that your personal site or spam in your sig?

imi_99
01-11-2007, 11:38 AM
http://php-mysql-tutorial.com

Is that your personal site or spam in your sig?


Is there something wrong. Because this is my personal site and I am thinking to implement voting system in it.

imi_99
01-11-2007, 11:40 AM
http://php-mysql-tutorial.com


There is nothing about drawing graph using php on this site. am i right

thetestingsite
01-12-2007, 01:54 AM
Take a look at the following links and see if this is what you are looking for.

http://dhtmlgoodies.com/index.html?whichScript=ajax-poller

A Demo:
http://dhtmlgoodies.com/scripts/ajax-poller/ajax-poller.html

Hope this helps.

imi_99
01-13-2007, 12:19 AM
this seems to me complicated. I have done all calculation that I got result now in format like

cars 33.33%, truck 40.13%

I only want to draw these figure in bars using gd or css.

thetestingsite
01-13-2007, 12:24 AM
If you are using the script in the link posted above, did the images even show up? If you could, either post a link to where you have placed the script, or send to me via PM or YIM. Maybe there's something missing or whatnot.

djr33
01-13-2007, 02:05 AM
1. There have been recent spam links in signatures soley for the purpose of promoting sites. I find any explicitly commercial site suspiscios. Nothing personal.

2. The link I gave you will tell you how to use a database. The math is easy... just average stuff. But you need to learn the basics before doing that.

3. As for creating graphs... I would suggest not doing it. If you MUST, then use PHP's GD library, but don't say I didn't warn you. It's complex and doesn't exactly work right all the time.
The other option is doing a simple graph, like a bar chart, for which you could use simple elements (divs) and just set the widths dynamically, or something like that.

thetestingsite
01-13-2007, 02:08 AM
1. There have been recent spam links in signatures soley for the purpose of promoting sites. I find any explicitly commercial site suspiscios. Nothing personal.


Was that referring to my sig or imi_99's?

EDIT: Nevermind, didn't even look at imi's sig

mburt
01-13-2007, 02:10 AM
Obviously not your sig, yours is your site link. Take a look at imi_99's link:
"free uk car listings"

djr33
01-13-2007, 02:13 AM
If it IS his site and it IS in question for this, it's still just... awkward. This isn't a place to advertise for commercial stuff. But... if it's a legit question, I suppose... fine.

imi_99
01-13-2007, 02:53 PM
thanks for your replies. I guesed that easy way of doing bar is use css using div. GD seems to me hard and also i am not good in object oriented php.


imi_99