Dear friends,
I am storing values in Array. My array looks like this::
balu 26 MCA gold -------------> first row of array
amar 27 MBA gold -------------> 2nd row of array
raja 28 MSC gold -------------> 3rd row of array
Now i would like to retrieve first row of array and its columns. I have to do in php.thanks in advance.suggestions required.
5 3209
Do you have any understanding of PHP?
How is the array built?
do a print_r() on your array and show us the results.
Do you have any understanding of PHP?
How is the array built?
do a print_r() on your array and show us the results.
- PHP code goes here
-
while ($row = oci_fetch_array ($stmt1, OCI_BOTH))
-
{
-
$tempArray = array('ABC_BANK_ID' => $row['ABC_BANK_ID'],
-
'ABC_BANKACCNT_STATUS' => $row['ABC_BANKACCNT_STATUS'],
-
'ABC_BANK_BSB' => $row['ABC_BANK_BSB'],
-
'ABC_BANK_ACCNAME' => $row['ABC_BANK_ACCNAME'],
-
'ABC_BANK_ADDRESS1' => $row['ABC_BANK_ADDRESS1'],
-
'ABC_BANK_ADDRESS2' => $row['ABC_BANK_ADDRESS2'],
-
'ABC_BANK_SUBURB' => $row['ABC_BANK_SUBURB'],
-
'ABC_BANK_ACCNUM' => $row['ABC_BANK_ACCNUM'],
-
'ABC_BANK_ACCNAME1' => $row['ABC_BANK_ACCNAME1'],
-
'ABC_BANK_ACCTYPE' => $row['ABC_BANK_ACCTYPE'],
-
'ABC_STATE_ID' => $row['ABC_STATE_ID'],
-
'ABC_BANK_NAME' => $row['ABC_BANK_NAME'],
-
'ABC_BANK_SUFFIX' => $row['ABC_BANK_SUFFIX'],
-
'ABC_ISO_COUNTRY_NUM_CODE' => $row['ABC_ISO_COUNTRY_NUM_CODE'],
-
'ABC_ISO_CURRENCY_NUM_CODE' => $row['ABC_ISO_CURRENCY_NUM_CODE'],
-
'ABC_MEMBER_ID' => $row['ABC_MEMBER_ID']
-
array_push($result, $tempArray);
I am doing Php from last 5 days. plz help me .
You access the array using the key.
The key is the first part of the array which is followed by the assignment:
[php]
$arr = array
(
'array_key1' => 'this is the first',
'array_key2' => 'this is the second'
);
// access it by the array keys:
echo $arr['array_key1'];
[/php]
Hope that helps.
WARNING:
Please enclose your posted code in [code] tags (See How to Ask a Question).
This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.
Please use [code] tags in future.
MODERATOR
Atli 5,058
Expert 4TB - PHP code goes here
-
while ($row = oci_fetch_array ($stmt1, OCI_BOTH))
-
{
-
$tempArray = array('ABC_BANK_ID' => $row['ABC_BANK_ID'],
-
'ABC_BANKACCNT_STATUS' => $row['ABC_BANKACCNT_STATUS'],
-
'ABC_BANK_BSB' => $row['ABC_BANK_BSB'],
-
'ABC_BANK_ACCNAME' => $row['ABC_BANK_ACCNAME'],
-
'ABC_BANK_ADDRESS1' => $row['ABC_BANK_ADDRESS1'],
-
'ABC_BANK_ADDRESS2' => $row['ABC_BANK_ADDRESS2'],
-
'ABC_BANK_SUBURB' => $row['ABC_BANK_SUBURB'],
-
'ABC_BANK_ACCNUM' => $row['ABC_BANK_ACCNUM'],
-
'ABC_BANK_ACCNAME1' => $row['ABC_BANK_ACCNAME1'],
-
'ABC_BANK_ACCTYPE' => $row['ABC_BANK_ACCTYPE'],
-
'ABC_STATE_ID' => $row['ABC_STATE_ID'],
-
'ABC_BANK_NAME' => $row['ABC_BANK_NAME'],
-
'ABC_BANK_SUFFIX' => $row['ABC_BANK_SUFFIX'],
-
'ABC_ISO_COUNTRY_NUM_CODE' => $row['ABC_ISO_COUNTRY_NUM_CODE'],
-
'ABC_ISO_CURRENCY_NUM_CODE' => $row['ABC_ISO_CURRENCY_NUM_CODE'],
-
'ABC_MEMBER_ID' => $row['ABC_MEMBER_ID']
-
array_push($result, $tempArray);
I am doing Php from last 5 days. plz help me .
Ok. Looking past the obvious syntax errors..
This is completely redundant.
You are essentially just copying the array, element by element, and then doing nothing with it.
You could just as well do: -
while ($row = oci_fetch_array ($stmt1, OCI_BOTH))
-
{
-
$tempArray = $row;
-
}
-
What are you actually trying to accomplish?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Jeremy Moncho |
last post by:
Hi guys,
I am having a comprehension problem for which I cannot seem to find an
answer (by banging my head on my keyboard.)
I have the following code which yields no results. I expect one...
|
by: Ann |
last post by:
Hello everyone, hope someone can help me with this.
I have a SQL stored procedure that inserts a record into a table,
creates a cursor to fetch the last record that was added to get the
unique...
|
by: Bnc119 |
last post by:
Hello, I have written a C# COM server that has a few methods and a
property called DataItems that returns an ArrayList. During the
course of execution the ArrayList gets populated with several...
|
by: asenthil |
last post by:
Hai to all,
this is senthil...
i'm now working in the field of VC++...
i want to connect a mysql database...
just now tried to retrieve rows from a simple
mysql database by using VC++
My...
|
by: angappan |
last post by:
to fetch a list of rows and columns from xml and to store it in array and how to count the dynamic rows and columns ........
Help with code and explanations ....
Iam very new to xml...
|
by: sruthini |
last post by:
Hi,
I am doing send some values(signup form::firstname,lastname,title,organization)
to mail id using javamail at the same time it should store in database, my problem is how to fetch values from...
|
by: sruthini |
last post by:
Hi,
I am doing send some values(signup form::firstname,lastname,title,organization)
to mail id using javamail at the same time it should store in database, my problem is how to fetch values from...
|
by: yasmine |
last post by:
Hi friends,
I'm having a table which stores id as comma separated in string datatype.
I want to fetch each of the value in a row in the form of array such as follows:
table:
sid ...
|
by: preethikuppusamy |
last post by:
I have included banner images in an array and used settimeout fun to dislay it in my home page.
Now i have included those banners in a table and now i have to fetch it from the table and include in...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
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
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |