Joomla Indonesia

Login or Sign Up
Sign In or Register
Not Registered Yet?

Join Now! It's FREE. Get full access and benefit from this site

Reset My password - Remind Me My username

Remember me
  • Home
    Home This is where you can find all the blog posts throughout the site.
  • Categories
    Categories Displays a list of categories from this blog.
  • Tags
    Tags Displays a list of tags that have been used in the blog.
  • Bloggers
    Bloggers Search for your favorite blogger from this site.
  • Team Blogs
    Team Blogs Find your favorite team blogs here.
  • Login
    Login Login form

Mengenal Database Class (getErrorNum)

Posted by on in Tutorial
  • Font size: Larger Smaller
  • Hits: 4580
  • Subscribe to this entry
  • Print
Fungsi getErrorNum menampilkan informasi kesalahan yang tengah terjadi pada database dalam bentuk kode error database.

Syntaxnya dituliskan sebagai berikut.

{xtypo_code} integer getErrorNum ( ){/xtypo_code}

{xtypo_code}$query = "SELECT * FROM 'table_salah'";
$database->setQuery( $query );
$rows = $database->loadObjectList();
if ($database->getErrorNum()) {
  echo 'Error ' . $database->getErrorNum() . ': ' . $database->getErrorMsg();
Maka akan menghasilkan output sebagai berikut.

{xtypo_code}Error 1064: You have an error in your SQL syntax near \'\'bad_table\'\' at line 1 SQL=SELECT * FROM \'bad_table\'{/xtypo_code}

  • No comments found

Kategori Blog

Joomla User Group Indonesia

Joomla User Group indonesia adalah situs resmi Joomla User Group (JUG) Indonesia dan Joomla Translation Team

Download Terjemahan Joomla terakreditasi dari JoomlaCode dan laporkan bugs, ide dan saran nya di Sub Forum Hanacaraka


twitter id joomlafb idjoomla