Author Topic: MySQL  (Read 7915 times)

0 Members and 1 Guest are viewing this topic.

Offline Dmitro

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
MySQL
« on: August 22, 2002, 12:53:24 AM »
Dear Jan,
I am trying to work out how to change the column auth_directupload in MySQL. I get MySQL error because the syntax is not correct. I don't know what is not correct, because I checked it with my book and it seems to be correct but...  

The task:

I want to change upload permission from 2 (Registered Users) to 9 (private) so that I can validate images.

I don't like an idea to change it from the Admin panel where I have to edit permissions for every category (133 at this moment). It takes really a lot of time, and I know there is a better way to do it, namely by working on MySQL via MyPHPadmin.

Instead of changing line by line I want to ALTER the MySQL table.
Could you please help me what is the syntax to do so?
Regards,
Dmitry
____________________
www.violadabraccio.com

Offline Dmitro

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Erroneous syntax
« Reply #1 on: August 22, 2002, 01:41:35 AM »
Sorry, I forgot to write the syntax I tried to use:

UPDATE 4images_categories SET auth_directupload = 3,
WHERE cat_id = 1;


I tried to use WHERE in order to avoid a grand disaster in case I make a bad mistake. Normally I'd like to set the value of auth_directupload = 3 for all cat_id.
Regards,
Dmitry
____________________
www.violadabraccio.com

Offline Dmitro

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Problem solved
« Reply #2 on: August 22, 2002, 01:52:23 AM »
:D Jan, I just crossed my fingers and pushed GO.

UPDATE 4images_categories SET auth_directupload = 3;

OK. It worked. All the categories were set to the desired permissions. Thanks for the clarity of the database! Well thought.

Dmitry
Regards,
Dmitry
____________________
www.violadabraccio.com

Offline Dmitro

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
How-to?
« Reply #3 on: September 09, 2002, 08:59:32 PM »
Dear Jan,

Again - a question.

How to modify data in a MySQL 4images_images table?

I have a column, called images_keywords.
In that column I have keywords such as viola braccio.
How to change it into viola_da_braccio?

I don't have yet a book about MySQL at hand. The commands which I have found on the Internet are correct, but I have not succeeded to make a sense of it. I did something wrong and had only MySQL errors.

Could you teach me about a correct syntax, please?

Thanks, indeed.
Dmitry
Regards,
Dmitry
____________________
www.violadabraccio.com

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
MySQL
« Reply #4 on: September 09, 2002, 09:24:40 PM »
Try phpMyAdmin. This is the best program to manage mysql databases.

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline Dmitro

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
MySQL
« Reply #5 on: September 09, 2002, 10:13:54 PM »
Jan, thanks for your reply.  
Thats what I use but I have to give it a correct command.
MySQL seems to be such a bestseller that, increadible, there is no single book in Brussels' shops!  :cry:
Dmitry
Regards,
Dmitry
____________________
www.violadabraccio.com

Offline Dmitro

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
Russian Lang
« Reply #6 on: September 09, 2002, 10:17:55 PM »
Jan, did you receive Russian language pack from me?
I translated it for you and sent yesterday.
Please, be careful - my computer is not russified - so the files were saved as Unicode!!! I already tried to combine Japanese and PHP typed in my computer and it did not work. :oops:
Dmitry
Regards,
Dmitry
____________________
www.violadabraccio.com

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
MySQL
« Reply #7 on: September 09, 2002, 11:58:09 PM »
Yes, i received your mail. I've give you no feedback because i'm very busy at the moment, sorry.

If you want to offer the language pack, please post it at the mods forum, thanks.

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline Dmitro

  • Jr. Member
  • **
  • Posts: 59
    • View Profile
UPDATE TABLE is resolved
« Reply #8 on: September 15, 2002, 01:59:05 PM »
Jan,

I solved the problem - you don't need to reply it.

I type here what I did, since it might be interesting for other users.

To update values in a specified column in a table (or a selection of a table),
open MyPHPadmin (I assume you have it installed on your server), and enter the following command:

UPDATE 4images_images SET image_keywords = 'your keywords separated by spaces' WHERE image_id = '2';
UPDATE 4images_images SET image_keywords = 'your other keywords separated by spaces' WHERE image_id = '3';

etc.

I assume you want to UPDATE table 4images_images and a column image_keywords. Of course, you can UPDATE any table and any COLUMN or COLUMNS.

Dmitry
Regards,
Dmitry
____________________
www.violadabraccio.com