Forum und email

fbsql_error

(PHP 4 >= 4.0.6, PHP 5)

fbsql_error — Returns the error message from previous operation

Descrição

string fbsql_error ([ resource $link_identifier ] )

Returns the error message from previous FrontBase operation.

Errors coming back from the fbsql database backend don't issue warnings. Instead, use fbsql_error() to retrieve the error text. Note that this function only returns the error code from the most recently executed fbsql function (not including fbsql_error() and fbsql_errno()), so if you want to use it, make sure you check the value before calling another fbsql function.

Parâmetros

link_identifier

Um identificador de conexão FrontBase retornado por fbsql_connect() ou fbsql_pconnect().

Se opcional e não especificado, a função tentará encontrar uma conexão aberta para o servidor FrontBase server e se não for encontrada uma conexão dessa ela irá tentar criar uma como se fbsql_connect() fosse chamada sem argumentos

Valor Retornado

Returns the error text from the last fbsql function, or '' (the empty string) if no error occurred.

Exemplos

Example#1 fbsql_error() Example

<?php
fbsql_connect
("marliesle");
echo 
fbsql_errno() . ": " fbsql_error() . "<br />";
fbsql_select_db("nonexistentdb");
echo 
fbsql_errno() . ": " fbsql_error() . "<br />";
$conn fbsql_query("SELECT * FROM nonexistenttable;");
echo 
fbsql_errno() . ": " fbsql_error() . "<br />";
?>