array fault using with mysql and php

Codes here !

Moderators: macek, egami, gesf

Post Reply
johnj
php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: array fault using with mysql and php

Post by johnj » Wed Aug 01, 2012 8:42 pm

you are fetching the data from mysql into the variable $sayi. After that, where are you using this???

NigelRen
php-forum Fan User
php-forum Fan User
Posts: 622
Joined: Fri Aug 05, 2011 9:53 am

Re: array fault using with mysql and php

Post by NigelRen » Wed Aug 01, 2012 11:37 pm

I'm not sure what your trying to achieve here with your SQL.
With your $k loop I assume your trying to go through each month - but with your SQL your checking 'month(date)='$kk'' - so your using the month from $kk instead?
As an aside - you could make the SQL do more of the work for you by doing something like

Code: Select all

select count(*)
   from new
   where erisim = '1' and year(date)='$ss
   group by month(date)
   order by month(date)
You could extend the idea to group by year as well which would give you a set of results which can be graphed easily.

NigelRen
php-forum Fan User
php-forum Fan User
Posts: 622
Joined: Fri Aug 05, 2011 9:53 am

Re: array fault using with mysql and php

Post by NigelRen » Wed Aug 01, 2012 11:52 pm

Have you tried replacing the $kk with $k in your original code?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest