need sql query to update columns

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • satyasampan
    New Member
    • Aug 2012
    • 9

    need sql query to update columns

    columns in my table are rollnum name surname father mobilenum address
    rollnum is primary key
    nee sql query to update details in a php form... please give syntax... thanks in advance
  • ariful alam
    New Member
    • Jan 2011
    • 185

    #2
    here it is:

    Code:
    update <table name>
    set <column name>=<text to change>
    [, <column name>=<text to change>,...]
    where rollnum=<roll number to change data>
    in box brackets is optional. if you need to update more than one column than you have to use that part without box bracket separating comma(,)'s each.

    hope works for you. :)

    Comment

    • satyasampan
      New Member
      • Aug 2012
      • 9

      #3
      i would like to link sql query with php form and need to submit them to database... but just not sql query

      Comment

      • ariful alam
        New Member
        • Jan 2011
        • 185

        #4
        Have a look @ http://www.w3schools.com/php/php_mysql_update.asp

        Hope works for you. :)

        Comment

        • satyasampan
          New Member
          • Aug 2012
          • 9

          #5
          i have to submit them using a form but not directly to database

          Comment

          • ariful alam
            New Member
            • Jan 2011
            • 185

            #6
            yea. you have to just create a HTML form that takes input those required data and post using <form>'s post or get method to a PHP page like that code above linked by clicking on submit button. After a successful/failed update query to database it will show you a message.

            Comment

            • ariful alam
              New Member
              • Jan 2011
              • 185

              #7
              Here is another example for you, what i described in post#6, before this post#7.

              update-a-mysql-database-field-data-with-html-form-and-php/

              Comment

              Working...