PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

mSQL> <MaxDB Funzioni
Last updated: Fri, 18 Jul 2008

view this page in

maxdb_warning_count

maxdb->warning_count

(PECL maxdb:1.0-7.6.00.38)

maxdb->warning_count — Returns the number of warnings from the last query for the given link

Descrizione

Procedural style:

int maxdb_warning_count ( resource $link )

Object oriented style (property):

maxdb
int$warning_count;

maxdb_warning_count() returns the number of warnings from the last query in the connection represented by the link parameter.

Valori restituiti

Number of warnings or zero if there are no warnings.

Esempi

Example #1 Object oriented style

<?php
$maxdb 
= new maxdb("localhost""MONA""RED""DEMODB");

/* check connection */
if (maxdb_connect_errno()) {
   
printf("Connect failed: %s\n"maxdb_connect_error());
   exit();
}

$maxdb->query("CREATE TABLE temp.mycity LIKE hotel.city");

/* a remarkable city in Wales */
$query "INSERT INTO temp.mycity (zip, name) VALUES('11111',
       'Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch')"
;

$maxdb->query($query);

printf ("Number of warning: %d\n"$maxdb->warning_count);

/* close connection */
$maxdb->close();
?>

Example #2 Procedural style

<?php
$link 
maxdb_connect("localhost""MONA""RED""DEMODB");

/* check connection */
if (maxdb_connect_errno()) {
   
printf("Connect failed: %s\n"maxdb_connect_error());
   exit();
}

maxdb_query($link"CREATE TABLE temp.mycity LIKE hotel.city");

/* a remarkable long city name in Wales */
$query "INSERT INTO temp.mycity (zip, name) VALUES('11111',
       'Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch')"
;

maxdb_query($link$query);

printf ("Number of warning: %d\n"maxdb_warning_count($link));

/* close connection */
maxdb_close($link);
?>

Il precedente esempio visualizzerĂ  qualcosa simile a:

Warning: maxdb_query(): -8004 POS(62) Constant must be compatible with column type and length <...>
Number of warning: 0


add a note add a note User Contributed Notes
maxdb_warning_count
There are no user contributed notes for this page.

mSQL> <MaxDB Funzioni
Last updated: Fri, 18 Jul 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites