- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Help in PHP access to database
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2003 01:58 PM
07-31-2003 01:58 PM
Hi All,
I??m new at PHP and I found some problems trying to pass a call to a function ( ABRE_CL() ) inside the option fied in the form.
Somebody can help ?
Regards
Bassoi
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2003 02:00 PM
07-31-2003 02:00 PM
Re: Help in PHP access to database
Sorry ,
The attachment is not so good !
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2003 02:01 PM
07-31-2003 02:01 PM
Re: Help in PHP access to database
Hi Again,
I??ll try the last time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2003 02:02 PM
07-31-2003 02:02 PM
Re: Help in PHP access to database
function HTML_Head() {
echo "
";
}
function HTML_Form() {
function ABRE_CL() {
$cnx = odbc_connect( 'Workload' , '', '' );
if (!$cnx) {
Error_handler( "Error in odbc_connect" , $cnx );
}
$cur= odbc_exec( $cnx, "select * from Clientes" );
if (!$cur) {
Error_handler( "Error in odbc_exec( no cursor returned ) " , $cnx );
}
$nbrow=0; //Local variable to count number of rows
// fetch the succesive result rows
while( odbc_fetch_row( $cur ) ) {
$nbrow++;
$desc= odbc_result( $cur, 2 ); // get the field "Descri????o"
echo "$desc
";
}
;
// close the connection. important if persistent connection are "On"
odbc_close( $cnx);
}
echo "
";
}
function HTML_Existing() {
echo "Database Workload OK";
}
function HTML_Foot() {
echo "";
}
HTML_Head();
HTML_Form();
HTML_Existing();
HTML_Foot();
?>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2003 01:39 AM
08-01-2003 01:39 AM
Re: Help in PHP access to database
You should just change in your call :
Benoit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2003 01:44 AM
08-01-2003 01:44 AM
Re: Help in PHP access to database
instead of :
echo "
";
do :
?>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2003 03:13 AM
08-01-2003 03:13 AM
Re: Help in PHP access to database
I did what you told me but didn??t work. We have no result inside
the form.
If I call the function ABRE_CL () from outside the form it works fine !
What can I do ?
Regards,
Bassoi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2003 04:59 AM
08-01-2003 04:59 AM
Re: Help in PHP access to database
I try this time , here's the solution :
echo "
";
nota :
You cannot include a second php call (Tell me if it's ok...
regards
Benoit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2003 05:34 AM
08-01-2003 05:34 AM
Re: Help in PHP access to database
Regards
Bassoi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2003 07:41 AM
08-01-2003 07:41 AM
Re: Help in PHP access to database
I made it works on my side !
Warning,
I have disabled the odbc functions (I don't have odbc built in),
here is the full source i used :
function HTML_Head() {
echo "
";
}
function HTML_Form() {
function ABRE_CL() {
echo "toto
";
return;
$cnx = odbc_connect( 'Workload' , '', '' );
if (!$cnx) {
Error_handler( "Error in odbc_connect" , $cnx );
}
$cur= odbc_exec( $cnx, "select * from Clientes" );
if (!$cur) {
Error_handler( "Error in odbc_exec( no cursor returned ) " , $cnx );
}
$nbrow=0; //Local variable to count number of rows
// fetch the succesive result rows
while( odbc_fetch_row( $cur ) ) {
$nbrow++;
$desc= odbc_result( $cur, 2 ); // get the field "DescriC'C#o"
echo "$desc
";
}
;
// close the connection. important if persistent connection are "On"
odbc_close( $cnx);
}
echo "
";
}
function HTML_Existing() {
echo "Database Workload OK";
}
function HTML_Foot() {
echo "";
}
HTML_Head();
HTML_Form();
HTML_Existing();
HTML_Foot();
?>
cut and paste it in a test.php file and try to access to it.
You should also see the source html file generated by php (view source in your browser), you can have interrested information...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2003 07:54 AM
08-01-2003 07:54 AM
SolutionI read a little more your script, you have also a trouble in the pure html side
:
If your connection to odbc is ko, you can see it by viewing the source of the html page.
if it's ok, then, change this line :
echo "$desc
";
to
echo "$desc";
to make a test (without odbc connection), from my previous sample, change :
echo "toto
";
to
echo "toto
";
echo "toto2
" ;
it should work !!
check also your odbc conectivity..
If you are running on HPUX (this is the name of this forum), I'm sure you can build php with odbc support (it's a WIN32 feature).
hope that help
Benoit