chrisdegrote

Topic: How to change the cities?

Dear readers,

I've got a question. I've followed the great tutorial on how to change the city names. I've deleted the cities table. But it keeps on showing the old Rumanian city listing. I've didn't make a back up(skipped that).Removed the old table in phpmyadmin, went to the sql tab and directly installed the USA code for test. But it doesn't displays any change.
Any tips?

chrisdegrote

Re: How to change the cities?

Some extra info
My web page is www.baanict.com and I've downloaded the latest version of Jobboarder installed with php 5 plus on a linux server. for more info please request

putypuruty

Re: How to change the cities?

Hi!

I recommend that you install this little 'plugin' I made which allows you to add/edit/delete cities directly from the admin section (don't worry, it's very easy to install):

http://www.jobberbase.com/forum/post3500.html#p3500

If you install it, your problem is almost solved wink

You should also do this: in phpmyadmin, run the following query (be sure that your jobberbase database is selected)

Code:
delete from cities where id != -1

This will remove all the Romanian cities.

Good luck!

chrisdegrote

Re: How to change the cities?

Well it works a bit now. I can''t add new cities. First I followed the steps you've clearly stated. Copy paste your content from  the zip file to the server. Afterwards I went to my phpadmin and did the query. Php admin gave an ok about the query. But the code didn't deleted the the cities? (maybe I have not enough rights?). Afterwards I checked the jobberbase admin and found the list. I edited the cities (deleting and editing not adding new cities). Because I didn't liked the order non alphabatical I deleted everything. Now I can't add anymore than one city. Any other input is accepeted but not placed in the admin panel. I believe the origin of the problem is that it doesn't communicate with mine mysql database.
I am willing to install jobberbase complete again but it would be a shame if it's a easy problem to solve
Thanx

Last edited by chrisdegrote (2009-04-26 00:37:25)

putypuruty

Re: How to change the cities?

Hi.

To have them sorted alphabetically, do this: open _includes/functions.php and find get_cities. A few rows below, replace

Code:
ORDER BY id

with

Code:
ORDER by name

As for your your other problem (not being able to add cities from the admin section), I don't know what to say. I've tried it on my machine even with an empty cities table and it worked. Are you sure that the id field from the cities table is set as AUTO INCREMENT? To check this, open phpmyadmin and select the cities table. Click on the 'Structure' tab and in the 'extra' column for the 'id' row you should have 'auto increment'. If you don't have it, try to run this query:

Code:
ALTER TABLE `cities` MODIFY COLUMN `id` INTEGER NOT NULL AUTO_INCREMENT;

Let us know if this worked.

Last edited by putypuruty (2009-04-26 10:57:53)

chrisdegrote

Re: How to change the cities?

Thanx for your reply but even now it doesn't work. I've swapped the code. and did the query and it is enabled. Because first it worked with the rumanian cities I am going to reinstall it Still thanx for your support

chrisdegrote

Re: How to change the cities?

Well I've did a total fresh install and followed your steps. This time with succes. Now I can add cities without any errors. And more than one. Thanx this helped me a lot!!!!