SQL query:

SELECT comment FROM.WHERE db_name = 'quadrilleDB'
AND table_name = ''
AND column_name = '(db_comment)'

MySQL said:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE db_name = 'quadrilleDB' AND table_name = '' AND c

i get this error with phpMyAdmin 2.6.-pl1, please help!!!!!! :o :o :o

    o thx, man, but what do i need to enter for the table name, coz i'm very new to php stuff.

      and i did try to enter a table name, but it still get the same error

        SELECT comment FROM.WHERE db_name = 'quadrilleDB'
        AND table_name = ''
        AND column_name = '(db_comment)'

        from the looks of it, youre a little confused.

        in order to use a certain table from a database, you need to use the USE function, i.e.
        USE <mytablename>;

        or if you are using php for your database, to get the table that you want to use, do something like this
        define ('DB_USER', 'your user name that you created in mysql');
        define ('DB_PASSWORD', 'use the password for your user name');
        define ('DB_HOST', 'your host name, probably localhost');
        define ('DB_NAME', 'your database name');

        put that in your php file to tell php what database to use, although it is smarter to keep this stuff in a seperate file, then import it using require_once('import_file.php'); but put the file below your documentRoot, so it cant be seen through ur browser.

        once you have your database chosen, sql syntax is like this
        SELECT column_name FROM table_name WHERE conditionals

        hope this helped some.

          Thx man,it almost work. But still confuess with this

          SELECT column_name FROM table_name WHERE conditionals

          how can i know where to found column_name and table_name

            and i have the following in my database

            quadrilleDB (27)
            binary_mc
            class
            clicking
            course
            dept
            dnd
            filling_blank
            group_info
            group_in_course
            learn
            matching
            paper
            paper_question
            question
            question_dynamic
            question_locked
            question_type
            result_question
            sql_log
            teach_class
            teach_course
            template_binary
            template_form
            template_link
            text_mc
            tf
            unit

              to see what tables you have, just type in to the mysql prompt

              show tables;

              this will provide you with a list of your tables.

              to see a description of a table, type

              describe tablename ;

              so say you have this scenario:

              create table customer (id_num mediumint unsigned auto_increment not null,
              [INDENT]customer_name varchar(30),[/INDENT]
              [INDENT]customer_email varchar(30), [/INDENT]
              [INDENT]customer_state varchar(2), [/INDENT]
              [INDENT]primary key (id_num))[/INDENT]

              now if you want to see all of the customer names for id_num's greater than 10, your query would look like this:

              SELECT customer_name FROM customer WHERE id_num > 10;

              Its that simple. To see everything in a table, you can use the * , i.e.

              SELECT * FROM customer WHERE id_num > 10 AND customer_state = 'OK';

              thats basically it.

              lemme know if you need more help. i dont get to be on the helping side that much, so ill help you as much as i can, cause it always seems like im the one who needs the help.

                Write a Reply...