This is a discussion on "[SOLVED] Need Help!" within the PHP Forum section. This forum, and the thread "[SOLVED] Need Help! are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] Need Help!
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
#1
|
|||
|
|||
|
[SOLVED] Need Help!
Hi Friends!
Here I am again, looking for some help. In my page I have people registered from different country. Now I want to show that in my page at a glance how many registered people from which country. And it should change the number automatically and should add the country name automatically for any new entry. Is it too complicated? If anyone would kind enough to show me the code and explain I would be graeful to you. Thanks |
|
|
|
#2
|
|||
|
|||
|
Re: Need Help!
What kind of a registration system do you have? A database? If so, which fields do you have in your users table?
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
#3
|
|||
|
|||
|
Re: Need Help!
Hi c010,
I am using MySQL and filed is userid(I user email address), password, Name , address, age, profession, tel, country, active. Hope that is you are asking. |
|
#4
|
|||
|
|||
|
Re: Need Help!
OK, then this should be relatively easy....
If you could explain a bit more in detail what kind of help you need (PHP code, or the mySQL query....). Or, even better, post some code....
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
#5
|
|||
|
|||
|
Re: Need Help!
pMaybe i can add a simple demonstration for you:
Last edited by Lucleonhart; Oct 25th, 2007 at 15:08. Reason: Just changed your [ code ] to [ php ] ;) |
|
#6
|
|||
|
|||
|
Re: Need Help!
Hi c010,
I need the full code for that as I am a novice in php. Your help woud be much appreciated. I want the result to be visible on my page in a text formant as Country No. of User Canada 10 Something like this. Thanks Hi Lucleonhart, Thanks for your code, but it is showing me only "Users from country: this nothing else....Pls let me know. |
|
#7
|
|||
|
|||
|
Re: Need Help!
Hi Lucleonhart,
Sory it was my mistake. It give me the number of people but not the country name eg: it is like this Users from country: 10 but no country name? |
|
#8
|
|||
|
|||
|
Re: Need Help!
Oh! there was an mistake from me. just delete one "$" of $$allc_row['country'] in the display line.
I have edited my last post. |
|
#9
|
|||
|
|||
|
Re: Need Help!
Great! it works fine. Now how we can show the result of the scripts on the page without manually running it. and I want that in two colum. first country and 2nd No. of user. Will it automatically update the info everytime you refresh the page ? Hope I am not asking too much?
|
|
#10
|
|||
|
|||
|
Re: Need Help!
Ehm.. it actually IS working automatically.. no?
So, you just place it at the position, where the results should appear:
For a table style with two collums, you start the table before the script and end it afterwards. Also you have to edit the display a bit. Here comes the example:
|
|
#11
|
|||
|
|||
|
Re: Need Help!
Hi,
I was just trying the basic one with following code and getting on page just "); } ?> any idea
Last edited by c010depunkk; Oct 25th, 2007 at 20:37. Reason: added [PHP] tags |
|
#12
|
|||
|
|||
|
Re: Need Help!
You have to consider, that this is a PHP script! You cannot open it like a normal document. Ithas to be parsed through a PHP server first.
To check it manually, you should install a package like xampp (http://www.apachefriends.org/de/xampp.html). It will install an Apache Webserver with PHP support and other additional featurs like MYSQL. So after you installed it, put your file in the "htdocs" directory of xampp, start xampp using the "xampp-control.exe" and open your browser. DO NOT simply open the file, instead type http://localhost/yourfilename.php localhost points to the "htdocs" folder of xampp. Now, the PHP script will be transmitted through the PHP server and will be executed. |
|
#13
|
|||
|
|||
|
Re: Need Help!
Hi Lucleonhart,
Yes, I am using a php server where it works fine with your first code. It just not working after I put that in to a existing html file as you described. Thanks |
|
#14
|
|||
|
|||
|
Re: Need Help!
How about posting the code you have. We can then have a look and see if we can spot the problem.
Last Blog Entry: 10 Reasons Why My Laptop Is Better Than Your Girlfriend (Dec 15th, 2007)
|
|
#15
|
|||
|
|||
|
Re: Need Help!
Hi,
Just see the three postings earlier , I have posted the code with error message, thanks |
|
#16
|
||||
|
||||
|
Re: Need Help!
can you upload the code in .txt format using an attachment?
__________________
Click the 'Thanks!' button if this post has helped you Rob - Webforumz Founder
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
#17
|
|||
|
|||
|
Re: Need Help!
|
|
#18
|
|||
|
|||
|
Re: Need Help!
|