How to Insert a String in MySQL
MySQL uses an "insert" statement to insert values into database tables. You must insert values into the right fields to keep data integrity. You create a string variable and insert it into the table field using the SQL language. The insert statement determines the table and field where you insert the string value.
Instructions
-
-
1
Click the Windows "Start" button and select "All Programs." Click "MySQL" then click "Query Browser." The SQL query editor opens where you create the code.
-
2
Create the string variable. The following code creates a customer variable:
set @customer = 'Joe Smith'
-
-
3
Insert the string into the MySQL table. The following code inserts the variable created in step two into the "customer" table:
insert into customer (name) values (@customer);
-
4
Click the "Execute" button to run the code. The string is created and the value is inserted in the table.
-
1