how to insert values into a mysql database?

in oracle we have the syntax as

insert into table_name values(&a,&b)

with which we can enter values at run time.

what is its equivalent in mysql database??

Comments

  • It is the same as SQL syntax, you run below command

    INSERT INTO phonebook(phone, firstname, lastname, address) VALUES('+1 123 456 7890', 'John', 'Doe', 'North America')

  • hi Im making use of VB 2008, i attempted including the Russian characters and it worked. And as a be counted of actuality I never pronounced the UTF set in my question. under is the code i Used. have a seem. Dim sqlcon As OleDbConnection = New OleDbConnection("information source=C:login.mdb; service=Microsoft.Jet.OLEDB.4.0; person id=Admin") sqlcon.Open() Dim ssql As String = "INSERT INTO login VALUES (@call,@password)"; Dim sqlcmd As OleDbCommand = New OleDbCommand(ssql, sqlcon) sqlcmd.Parameters.AddWithValue("@call";, TextBox1.text cloth) sqlcmd.Parameters.AddWithValue("@passwor... TextBox2.text cloth) sqlcmd.ExecuteNonQuery() I COPIED THE RUSSIAN CHARACTERS TO TEXTBOX1 and that they artwork.

  • INSERT INTO table_name (values,values) VALUES (data,data);

  • For eg:

    $name = $_post['name'];

    $address = $_post['address'];

    $phone = $_post['phone'];

    $result= mysql_query("insert into table_name (id,name,address,phone) values (' ', '$name', '$address', '$phone').mysql_error()");

    if($result)

    {

    echo "<script>alert('successfully inserted');

    }

    else

    {

    echo "failed to insert";

    }

Sign In or Register to comment.