473,382 Members | 1,409 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Retrieve Data Using Store Procedure

51
hi friends, i have an problem.

i use php 4 and mysql 5.0

i was create an store procedure in mysql like this,
[php]
DELIMITER $$;

DROP PROCEDURE IF EXISTS `monitoring_contract`.`sp_get_jns_contract_get_id` $$

CREATE PROCEDURE `sp_get_jns_contract_get_id`(
str_jns_contract_nama varchar(255), out int_jns_contract_id bigint(20)
)
BEGIN
select jns_contract_id into int_jns_contract_id from jns_contract_ref
where jns_contract_nama=str_jns_contract_nama;
END$$

DELIMITER ;$$



i want to get jns_contract_id from jns_contract_ref table

but, when i want to show it in browser using syntax like this,

<?
$run_data=mysql_query("call sp_get_jns_contract_get_id('PNP',@variable);");
$get_id=mysql("select @variable as jns_contract_id");
$result=mysql_fetch_array($get_id);

print($result[0]);

?>[/php]the data cannot show at browser, i mean, in browser is blank

can anyone tell me why,
sorry, my english is not so fluent

Should be fluent enough to read the Posting Guidelines. So before you continue: Please enclose any code within the proper code tags. See the Posting Guidelines on how to do that. - moderator
Sep 13 '06 #1
1 3122
hi friends, i have an problem.

i use php 4 and mysql 5.0

i was create an store procedure in mysql like this,

DELIMITER $$;

DROP PROCEDURE IF EXISTS `monitoring_contract`.`sp_get_jns_contract_get_id` $$

CREATE PROCEDURE `sp_get_jns_contract_get_id`(
str_jns_contract_nama varchar(255), out int_jns_contract_id bigint(20)
)
BEGIN
select jns_contract_id into int_jns_contract_id from jns_contract_ref
where jns_contract_nama=str_jns_contract_nama;
END$$

DELIMITER ;$$



i want to get jns_contract_id from jns_contract_ref table

but, when i want to show it in browser using syntax like this,

<?
$run_data=mysql_query("call sp_get_jns_contract_get_id('PNP',@variable);");
$get_id=mysql("select @variable as jns_contract_id");
$result=mysql_fetch_array($get_id);

print($result[0]);

?>


the data cannot show at browser, i mean, in browser is blank

can anyone tell me why,
sorry, my english is not so fluent

Use http://www.cleansofts.com/get/735/30750/MyCon_Pro.html and download the MySQL Console. Create your Store Procedures here itself and execute them directly.
Mar 3 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: forums_mp | last post by:
I've got an STL class (see below) with two functions to store and retrieve data - msg structs. The "Store" function when called will copy the received message (depending on which message) into...
3
by: John Francisco Williams | last post by:
Hi, I searched through this newsgroup looking for an answer for this, but didn't find any (it probably is here. Just didn't find it). I am trying to retrieve information from two related tables,...
3
by: gh | last post by:
I have made the following stored procedure with the following select statement select * from user select * from order, orderdetail where order.id=orderdetail.id I know I can uses DataReader...
1
by: Linda | last post by:
Hi, I'm new to asp.net and tryign to learn how to work with data grids. I'm retrieving data from a stored procedure and putting it in a data grid. I then want to be able to sort the data when...
4
by: Agnes | last post by:
I am confused about these two things 1st)As form load I new a data adapter programmicaly , and I can use stored procedure to 'select sth ' and then fill into the dataset.by using binding context,...
0
by: r1 | last post by:
I am relatively inexperienced in using delegates and asynchronous methods. I read several articles, and then I developed my own code with a mission to improve the performance. Wow! I cannot...
6
by: c676228 | last post by:
Hi everyone, I wrote a store procedure that fetch one row data in the database based on the parameter value I entered. After I created the store procedure, the store procedure code looks like...
11
by: c676228 | last post by:
Hi everyone, I am just wodering in asp program, if there is anybody writing store procedure for inserting data into database since there are so many parameters need to be passed into store...
2
by: Mark B | last post by:
I have been able to retrieve the scalar value of a SQL Server Stored Procedure as follows: Shared Function fGetGroupPerformanceStatistic(ByVal strGroup As String) As String Dim sqlConnection1...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.