📚 Looking for current Exponential documentation? This site contains legacy SDK & API reference docs (eZ Publish era). For up-to-date 2026 product documentation, visit doc.exponential.earth.

  ezdb / store  

<< Fetch data   

Before you do a write operation to the database you must start a new transaction. This is done with the $db->begin() function. Then you need to escape the data which you want to store, this is done with the $db->escapeString() function.

  // prepare the data for database storage
  $str = $db->escapeString( "Testing escaping'\"" );

  // start a new transaction
  $db->begin();
  // send the SQL INSERT command to the database
  $db->query( "INSERT INTO sql_test ( name, description ) VALUES ( 'New test', '$str' )" );
  // commit the transaction
  $db->commit();

  // fetch the last automatically incremented value
  $rowID = $db->lastSerialID( "sql_test", "id" );

Exponential Copyright © 1998 - 2026 7x