Alejandro Michelin Salomon | 5 Jul 2005 16:11
Picon
Picon
Favicon

GetMenu, Adding funcionality

Hi :

I test the GetMenu method of ADORecordSet class.

I get a nice select tag with data from my database.

My code without getmenu :

function CargoNiveis( $idnivel, $Connection )
{
$sSql  = " SELECT idnivel, descricao ";
$sSql .=   " FROM co_niveis ";
$sSql .=  " ORDER BY descricao ";

$rs = $Connection->Execute( $sSql );

if ( !$rs )
    exit(" Erro : ao Procurar Niveis = > " . mysql_error());

print "<option value=\"20\" selected>Escolha um Nivel</option>"; <---
this line i cannot add with GetMenu.

while ( !$rs->EOF )
{
    if ( $rs->fields["idnivel"] == $idnivel )
        print "<option value=\"{$rs->fields["idnivel"]}\"
selected>{$rs->fields["descripcao"]}</option>";
    else
        print "<option
value=\"{$rs->fields["idnivel"]}\">{$rs->fields["descripcao"]}</option>"
(Continue reading)

Alejandro Michelin Salomon | 6 Jul 2005 14:42
Picon
Picon
Favicon

RES: GetMenu, Adding funcionality

Hi :

I solved the problem, reading the adodb code.

GetMenu($name, [$default_str=''], [$blank1stItem=true],
[$multiple_select=false], [$size=0], [$moreAttr=''])

The parameter $blank1stItem, can be false, true, or a string with this
format ( '{value}:{description}' ).

{value}       --> Value to value attribute.
:             --> Separator
{description} --> Description to see.

This is the code without blank item :

$rs->GetMenu( 'teste', $idnivel, false, false, 0, $sStyle );

This with blank item :

$rs->GetMenu( 'teste', $idnivel, '20:Escolha um Nivel', false, 0,
$sStyle );

Note :
The adodb documentation does not say that parameter $blank1stItem, can
be a string.

Alejandro M.S

-----Mensagem original-----
(Continue reading)

Paul Tugwell | 7 Jul 2005 11:00
Picon

Return error value from stored procedure

I am new to ADOdb, so please excuse me if this is a stupid question

 

I have a stored procedure that when send a string read from a barcode, decodes the string into several parts then checks whether a record exists in a Firebird 1.5 database related to this barcode. This can produce 3 possible results

1) The barcode has an invalid format e.g. it does not contain the expected information

2) The barcode has a valid format, but there is no related record in the database

3) The barcode has a valid format, and a related record exists in the database

 

Scenarios 1 and 2 each return a different custom message generated by a Firebird exception

Scenario 3 returns a result set

 

I am using the following code in php

 

sql = "SELECT BAR_TYPE, COIL, COIL_SX, MATERIAL, QTY, WEIGHT FROM READ_BARCODE('".$_POST["edtBarcode"]."')";

$rs = $conn->Execute($sql);

 

If a valid barcode is entered, I get the expected result

 

If an invalid barcode is entered, how do I detect the error message returned?

 

operationsengineer1 | 8 Jul 2005 17:31
Picon
Favicon

Return error value from stored procedure

are you looking for the error from your stored
procedure?  if so, i'm not sure if the following will
work...

if{ (!$recordSet) 
	print $conn->ErrorMsg();
}else{
...
}

taken from the manual (w/ added if, else brackets)...

http://phplens.com/lens/adodb/docs-adodb.htm#ex1

--- adodb-general-request <at> lists.sourceforge.net wrote:

> Send ADodb-general mailing list submissions to
> 	adodb-general <at> lists.sourceforge.net
> 
> To subscribe or unsubscribe via the World Wide Web,
> visit
> 
>
https://lists.sourceforge.net/lists/listinfo/adodb-general
> or, via email, send a message with subject or body
> 'help' to
> 	adodb-general-request <at> lists.sourceforge.net
> 
> You can reach the person managing the list at
> 	adodb-general-admin <at> lists.sourceforge.net
> 
> When replying, please edit your Subject line so it
> is more specific
> than "Re: Contents of ADodb-general digest..."
> 
> 
> Today's Topics:
> 
>    1. Return error value from stored procedure (Paul
> Tugwell)
> 
> --__--__--
> 
> Message: 1
> Date: Thu, 7 Jul 2005 10:00:57 +0100
> From: "Paul Tugwell" <Paul <at> guardbase.co.uk>
> To: <adodb-general <at> lists.sourceforge.net>
> Subject: [ADodb-general] Return error value from
> stored procedure
> 
> This is a multi-part message in MIME format.
> 
> ------_=_NextPart_001_01C582D2.6385AC58
> Content-Type: text/plain;
> 	charset="us-ascii"
> Content-Transfer-Encoding: quoted-printable
> 
> I am new to ADOdb, so please excuse me if this is a
> stupid question
> 
> =20
> 
> I have a stored procedure that when send a string
> read from a barcode,
> decodes the string into several parts then checks
> whether a record
> exists in a Firebird 1.5 database related to this
> barcode. This can
> produce 3 possible results
> 
> 1) The barcode has an invalid format e.g. it does
> not contain the
> expected information
> 
> 2) The barcode has a valid format, but there is no
> related record in the
> database
> 
> 3) The barcode has a valid format, and a related
> record exists in the
> database
> 
> =20
> 
> Scenarios 1 and 2 each return a different custom
> message generated by a
> Firebird exception
> 
> Scenario 3 returns a result set
> 
> =20
> 
> I am using the following code in php
> 
> =20
> 
> sql =3D "SELECT BAR_TYPE, COIL, COIL_SX, MATERIAL,
> QTY, WEIGHT FROM
> READ_BARCODE('".$_POST["edtBarcode"]."')";
> 
> $rs =3D $conn->Execute($sql);
> 
> =20
> 
> If a valid barcode is entered, I get the expected
> result
> 
> =20
> 
> If an invalid barcode is entered, how do I detect
> the error message
> returned?
> 
> =20
> 
> 
> ------_=_NextPart_001_01C582D2.6385AC58
> Content-Type: text/html;
> 	charset="us-ascii"
> Content-Transfer-Encoding: quoted-printable
> 
> <html
> xmlns:o=3D"urn:schemas-microsoft-com:office:office"
> =
> xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
> xmlns=3D"http://www.w3.org/TR/REC-html40">
> 
> <head>
> <meta http-equiv=3DContent-Type
> content=3D"text/html; =
> charset=3Dus-ascii">
> <meta name=3DGenerator content=3D"Microsoft Word 11
> (filtered medium)">
> <style>
> <!--
>  /* Style Definitions */
>  p.MsoNormal, li.MsoNormal, div.MsoNormal
> 	{margin:0cm;
> 	margin-bottom:.0001pt;
> 	font-size:10.0pt;
> 	font-family:Arial;}
> h1
> 	{margin-top:0cm;
> 	margin-right:0cm;
> 	margin-bottom:12.0pt;
> 	margin-left:0cm;
> 	page-break-after:avoid;
> 	font-size:16.0pt;
> 	font-family:Arial;
> 	text-decoration:underline;}
> h2
> 	{margin:0cm;
> 	margin-bottom:.0001pt;
> 	page-break-after:avoid;
> 	font-size:10.0pt;
> 	font-family:Arial;
> 	text-decoration:underline;}
> h3
> 	{margin:0cm;
> 	margin-bottom:.0001pt;
> 	page-break-after:avoid;
> 	font-size:10.0pt;
> 	font-family:Arial;}
> a:link, span.MsoHyperlink
> 	{color:blue;
> 	text-decoration:underline;}
> a:visited, span.MsoHyperlinkFollowed
> 	{color:purple;
> 	text-decoration:underline;}
> span.EmailStyle17
> 	{mso-style-type:personal-compose;
> 	font-family:Arial;
> 	color:windowtext;}
>  <at> page Section1
> 	{size:595.3pt 841.9pt;
> 	margin:2.0cm 2.0cm 2.0cm 2.0cm;}
> div.Section1
> 	{page:Section1;}
> -->
> </style>
> 
> </head>
> 
> <body lang=3DEN-GB link=3Dblue vlink=3Dpurple>
> 
> <div class=3DSection1>
> 
> <p class=3DMsoNormal><font size=3D2
> face=3DArial><span =
> style=3D'font-size:10.0pt'>I am
> new to ADOdb, so please excuse me if this is a
> stupid =
> question<o:p></o:p></span></font></p>
> 
> <p class=3DMsoNormal><font size=3D2
> face=3DArial><span =
>
style=3D'font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></p>
> 
> <p class=3DMsoNormal><font size=3D2
> face=3DArial><span =
> style=3D'font-size:10.0pt'>I
> have a stored procedure that when send a string read
> from a barcode, =
> decodes
> the string into several parts then checks whether a
> record exists in a =
> Firebird
> 1.5 database related to this barcode. This can
> produce 3 possible =
> results<o:p></o:p></span></font></p>
> 
> <p class=3DMsoNormal><font size=3D2
> face=3DArial><span =
> style=3D'font-size:10.0pt'>1)
> The barcode has an invalid format e.g. it does not
> contain the expected
> information<o:p></o:p></span></font></p>
> 
> 
=== message truncated ===

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP, 
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
Paul Tugwell | 8 Jul 2005 17:57
Picon

RE: Return error value from stored procedure

Thanks for the reply. That's what I tried before sending the e-mail.
Unfortunately !$recordset seems to always to be false whether the stored
procedure has returned a result set or an error message, so the else
clause is always invoked.

-----Original Message-----
From: adodb-general-admin <at> lists.sourceforge.net
[mailto:adodb-general-admin <at> lists.sourceforge.net] On Behalf Of
operationsengineer1 <at> yahoo.com
Sent: 08 July 2005 15:32
To: adodb-general <at> lists.sourceforge.net
Subject: [ADodb-general] Return error value from stored procedure

are you looking for the error from your stored
procedure?  if so, i'm not sure if the following will
work...

if{ (!$recordSet) 
	print $conn->ErrorMsg();
}else{
...
}

taken from the manual (w/ added if, else brackets)...

http://phplens.com/lens/adodb/docs-adodb.htm#ex1

--- adodb-general-request <at> lists.sourceforge.net wrote:

> Send ADodb-general mailing list submissions to
> 	adodb-general <at> lists.sourceforge.net
> 
> To subscribe or unsubscribe via the World Wide Web,
> visit
> 
>
https://lists.sourceforge.net/lists/listinfo/adodb-general
> or, via email, send a message with subject or body
> 'help' to
> 	adodb-general-request <at> lists.sourceforge.net
> 
> You can reach the person managing the list at
> 	adodb-general-admin <at> lists.sourceforge.net
> 
> When replying, please edit your Subject line so it
> is more specific
> than "Re: Contents of ADodb-general digest..."
> 
> 
> Today's Topics:
> 
>    1. Return error value from stored procedure (Paul
> Tugwell)
> 
> --__--__--
> 
> Message: 1
> Date: Thu, 7 Jul 2005 10:00:57 +0100
> From: "Paul Tugwell" <Paul <at> guardbase.co.uk>
> To: <adodb-general <at> lists.sourceforge.net>
> Subject: [ADodb-general] Return error value from
> stored procedure
> 
> This is a multi-part message in MIME format.
> 
> ------_=_NextPart_001_01C582D2.6385AC58
> Content-Type: text/plain;
> 	charset="us-ascii"
> Content-Transfer-Encoding: quoted-printable
> 
> I am new to ADOdb, so please excuse me if this is a
> stupid question
> 
> =20
> 
> I have a stored procedure that when send a string
> read from a barcode,
> decodes the string into several parts then checks
> whether a record
> exists in a Firebird 1.5 database related to this
> barcode. This can
> produce 3 possible results
> 
> 1) The barcode has an invalid format e.g. it does
> not contain the
> expected information
> 
> 2) The barcode has a valid format, but there is no
> related record in the
> database
> 
> 3) The barcode has a valid format, and a related
> record exists in the
> database
> 
> =20
> 
> Scenarios 1 and 2 each return a different custom
> message generated by a
> Firebird exception
> 
> Scenario 3 returns a result set
> 
> =20
> 
> I am using the following code in php
> 
> =20
> 
> sql =3D "SELECT BAR_TYPE, COIL, COIL_SX, MATERIAL,
> QTY, WEIGHT FROM
> READ_BARCODE('".$_POST["edtBarcode"]."')";
> 
> $rs =3D $conn->Execute($sql);
> 
> =20
> 
> If a valid barcode is entered, I get the expected
> result
> 
> =20
> 
> If an invalid barcode is entered, how do I detect
> the error message
> returned?
> 
> =20
> 
> 
> ------_=_NextPart_001_01C582D2.6385AC58
> Content-Type: text/html;
> 	charset="us-ascii"
> Content-Transfer-Encoding: quoted-printable
> 
> <html
> xmlns:o=3D"urn:schemas-microsoft-com:office:office"
> =
> xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
> xmlns=3D"http://www.w3.org/TR/REC-html40">
> 
> <head>
> <meta http-equiv=3DContent-Type
> content=3D"text/html; =
> charset=3Dus-ascii">
> <meta name=3DGenerator content=3D"Microsoft Word 11
> (filtered medium)">
> <style>
> <!--
>  /* Style Definitions */
>  p.MsoNormal, li.MsoNormal, div.MsoNormal
> 	{margin:0cm;
> 	margin-bottom:.0001pt;
> 	font-size:10.0pt;
> 	font-family:Arial;}
> h1
> 	{margin-top:0cm;
> 	margin-right:0cm;
> 	margin-bottom:12.0pt;
> 	margin-left:0cm;
> 	page-break-after:avoid;
> 	font-size:16.0pt;
> 	font-family:Arial;
> 	text-decoration:underline;}
> h2
> 	{margin:0cm;
> 	margin-bottom:.0001pt;
> 	page-break-after:avoid;
> 	font-size:10.0pt;
> 	font-family:Arial;
> 	text-decoration:underline;}
> h3
> 	{margin:0cm;
> 	margin-bottom:.0001pt;
> 	page-break-after:avoid;
> 	font-size:10.0pt;
> 	font-family:Arial;}
> a:link, span.MsoHyperlink
> 	{color:blue;
> 	text-decoration:underline;}
> a:visited, span.MsoHyperlinkFollowed
> 	{color:purple;
> 	text-decoration:underline;}
> span.EmailStyle17
> 	{mso-style-type:personal-compose;
> 	font-family:Arial;
> 	color:windowtext;}
>  <at> page Section1
> 	{size:595.3pt 841.9pt;
> 	margin:2.0cm 2.0cm 2.0cm 2.0cm;}
> div.Section1
> 	{page:Section1;}
> -->
> </style>
> 
> </head>
> 
> <body lang=3DEN-GB link=3Dblue vlink=3Dpurple>
> 
> <div class=3DSection1>
> 
> <p class=3DMsoNormal><font size=3D2
> face=3DArial><span =
> style=3D'font-size:10.0pt'>I am
> new to ADOdb, so please excuse me if this is a
> stupid =
> question<o:p></o:p></span></font></p>
> 
> <p class=3DMsoNormal><font size=3D2
> face=3DArial><span =
>
style=3D'font-size:10.0pt'><o:p>&nbsp;</o:p></span></font></p>
> 
> <p class=3DMsoNormal><font size=3D2
> face=3DArial><span =
> style=3D'font-size:10.0pt'>I
> have a stored procedure that when send a string read
> from a barcode, =
> decodes
> the string into several parts then checks whether a
> record exists in a =
> Firebird
> 1.5 database related to this barcode. This can
> produce 3 possible =
> results<o:p></o:p></span></font></p>
> 
> <p class=3DMsoNormal><font size=3D2
> face=3DArial><span =
> style=3D'font-size:10.0pt'>1)
> The barcode has an invalid format e.g. it does not
> contain the expected
> information<o:p></o:p></span></font></p>
> 
> 
=== message truncated ===

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar
happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by
HP, 
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
_______________________________________________
ADodb-general mailing list
ADodb-general <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/adodb-general

-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP, 
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar
operationsengineer1 | 11 Jul 2005 21:04
Picon
Favicon

Return error value from stored procedure

you can ask here...

http://phplens.com/lens/lensforum/topics.php?id=4

also, you can check and see if recordcount = 0 (or is
null, not sure of the behavior or the options).  that
will obviously trigger even if the stored procedure
fires and returns 0 records.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-------------------------------------------------------
This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening
July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual
core and dual graphics technology at this free one hour event hosted by HP, 
AMD, and NVIDIA.  To register visit http://www.hp.com/go/dualwebinar

Gmane