Newbie question: how fill SQL database..

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I've made a database with phpmyadmin.
Now I want to add text to the fields i"ve made.
Can i do this trough phpmyadmin or how can i do this?

I've got these fields.
id  int(11)    No Null   auto_increment
titel  varchar(50)    No  Null
bericht  text    No Null
datum  varchar(16)    No Null

Can I add text to these fields from phpmyadmin?
Or do i have to use php to fill it?
Could someone please help me make a php page that can fill this
My aim is not to use this, but to learn how i can do it myself.
I'm a newbie to mysql and php but willing to learn...


Re: Newbie question: how fill SQL database..

You can use phpMyAdmin. Click the Insert icon in the Action column when
viewing your database tables.

You can also use MySQL Query Browser which is a MySQL front-end for

Using php code and the MDB2 API you can do something like the


// Include the PEAR library


// This function accesses the database

function doit()
  // Setup error handling for this script


  // Connect to the database using MDB2

  $db =& MDB2::singleton(
  $portOpt = $db->getOption('portability');
  $db->setOption('portability', $portOpt ^ MDB2_PORTABILITY_FIX_CASE);

  // Define the row data

  $row = array(
    'titel' => 'The Titel',
    'bericht' => 'Bericht',
    'datum' => 'datum'

  // Insert the row

 $db->extended->autoExecute('myTable', $row,

  // Get the inserted row ID

  $id = $db->lastInsertID('myTable', 'id');
  echo "Inserted a new row with ID $id.";



More info about MDB2 here:

Best Regards,

John Peters

µ wrote:
Quoted text here. Click to load it

Re: Newbie question: how fill SQL database..

Thanks, i found it!
Thanks a lot...

Quoted text here. Click to load it

Site Timeline