OkFx.Net, get rebates from your trade

Query insert database

After we create database reseller, we can insert data to database.

For insert data at php we must query insert

mysql_query( ”
insert into database_name
set query that will execute
“) or error( mysql_error() );

dont forget “” inside ( )

Example at php

mysql_query( ”
insert into reseller set
username = ‘$_POST[username]’,
passwd = ‘$_POST[passwd]’,
name = ‘$_POST[name]’,
email = ‘$_POST[email]’”) or error( mysql_error() );

$_POST[username] is form input text with name username with method=”post

Example 2

mysql_query( ”
insert into reseller set
username = ‘johnson’,
passwd = ‘johnson$32#’,
name = ‘Johnson Gunawan’,
email = ‘Johnson@yahoo.com’
“) or error( mysql_error() );

, used at first and one before last query that will execute
At last query that will execute not use ,

Example 2 result :
It will insert database reseller :

  • field username with value johnson
  • field passwd with value johnson$32#
  • field name with value Johnson Gunawan
  • field email with value Johnson@yahoo.com

Related post :
  • Query update database
  • What is MySQL?
  • Using the Query Wizard in Excel 2003
  • BCS ADO and DBGrid Field Sort
  • Querying a Web Page in Excel 2003
  • One Response to “Query insert database”

    1. ??? Says:

      Thanks your message has very much helped me:)


      reply

    Leave a Reply