please give me a query for already existing name in the data base

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sudheerk
    New Member
    • Jul 2007
    • 13

    please give me a query for already existing name in the data base

    please give me a query for already existing name in the data base using mysql
  • pbmods
    Recognized Expert Expert
    • Apr 2007
    • 5821

    #2
    Heya, sudheerk.

    [code=mysql]
    SELECT
    *
    FROM
    `Table`
    WHERE
    `Name` = 'someName'
    LIMIT 1;
    [/code]

    Comment

    • sudheerk
      New Member
      • Jul 2007
      • 13

      #3
      hi thank u,

      but table name means

      Is it existing table name ?


      Originally posted by pbmods
      Heya, sudheerk.

      [code=mysql]
      SELECT
      *
      FROM
      `Table`
      WHERE
      `Name` = 'someName'
      LIMIT 1;
      [/code]

      Comment

      • mwasif
        Recognized Expert Contributor
        • Jul 2006
        • 802

        #4
        Replace Table with your database table name in question and Name with database table column.

        Comment

        • sudheerk
          New Member
          • Jul 2007
          • 13

          #5
          the same thing i was done its not working

          plz plz give me a example progrm


          Originally posted by mwasif
          Replace Table with your database table name in question and Name with database table column.

          Comment

          • mwasif
            Recognized Expert Contributor
            • Jul 2006
            • 802

            #6
            Please tell us your table structure (table name and the columns you have in the table).

            Comment

            • sudheerk
              New Member
              • Jul 2007
              • 13

              #7
              i have 4 fields like below

              id name email phone

              submit(button)

              now i want already exist name should not store in the data base once again.

              my table name is sudha

              my data base name is sudheer


              thank u for u r response
              sudheer

              Originally posted by mwasif
              Please tell us your table structure (table name and the columns you have in the table).

              Comment

              • r035198x
                MVP
                • Sep 2006
                • 13225

                #8
                Originally posted by sudheerk
                i have 4 fields like below

                id name email phone

                submit(button)

                now i want already exist name should not store in the data base once again.

                my table name is sudha

                my data base name is sudheer


                thank u for u r response
                sudheer
                Sounds like a good candidate for a trigger. Are you using MySQL 5.0 or higher?

                Comment

                • sudheerk
                  New Member
                  • Jul 2007
                  • 13

                  #9
                  exactly iam not getting u r point.

                  but my sql version is 2.6.1


                  Originally posted by r035198x
                  Sounds like a good candidate for a trigger. Are you using MySQL 5.0 or higher?

                  Comment

                  • r035198x
                    MVP
                    • Sep 2006
                    • 13225

                    #10
                    Originally posted by sudheerk
                    exactly iam not getting u r point.

                    but my sql version is 2.6.1
                    That's old. Are you sure it's 2.6.1?
                    Anyway if you don't have trigger support for your MySQL version then you may have to do a select from the table where name = newName. If it returns any data then don't add the new name (It's already there).

                    Comment

                    • mwasif
                      Recognized Expert Contributor
                      • Jul 2006
                      • 802

                      #11
                      Do you know how to save data in database using PHP?

                      Comment

                      • sudheerk
                        New Member
                        • Jul 2007
                        • 13

                        #12
                        no sir,

                        and also trigger concept

                        so plz give me exact query to do that thing ie already existing name in the data base


                        Originally posted by mwasif
                        Do you know how to save data in database using PHP?

                        Comment

                        • sudheerk
                          New Member
                          • Jul 2007
                          • 13

                          #13
                          MYSQL 4.1.10a LICENSE

                          now i got my musql vrsion sir ie 4.1.10

                          now tell me sir

                          give me a small example program



                          Originally posted by sudheerk
                          no sir,

                          and also trigger concept

                          so plz give me exact query to do that thing ie already existing name in the data base

                          Comment

                          • kovik
                            Recognized Expert Top Contributor
                            • Jun 2007
                            • 1044

                            #14
                            Stop being such a beggar and try. There's a million resources in Google about basic MySQL queries, and theres an entire manual at http://dev.mysql.com/doc and most installations of MySQL come with the manual. You've already been given the syntax, now get to work.

                            Comment

                            • mwasif
                              Recognized Expert Contributor
                              • Jul 2006
                              • 802

                              #15
                              Originally posted by sudheerk
                              no sir,

                              and also trigger concept

                              so plz give me exact query to do that thing ie already existing name in the data base
                              This is the query
                              [CODE=mysql]SELECT * FROM sudha WHERE name = 'username';[/CODE]
                              Replace username with the user name you want to know about.
                              To accomplish your task you need the following
                              1. Post data using HTML form
                              2. Connect to database using PHP
                              3. Retrieve data from database using PHP

                              Comment

                              Working...