473,663 Members | 2,864 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Fetch array values

65 New Member
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 name
2,3,5,7,9... Apple
19,37,46,1... Orange

What i need is,
array[0]=2 array[1]=3......

each comma separated value should be in separate array.

How can i do this either in php script or in mysql?
I tried it by explode() function of php. But didn't work properly...
Please, help me out.

Thanx n Regards
Yas....
Apr 4 '08 #1
1 2810
ronverdonk
4,258 Recognized Expert Specialist
You are doing PHP programming now for quite some time. And all you have to do is store each exploded entry in another entry to an array.[php]<?php
$string='2,3,5, 7,9';
$a_arr=explode( ',', $string);
$b_arr=array();
foreach($a_arr as $val)
$b_arr[]=array($val);
?>[/php]Ronald
Apr 4 '08 #2

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

Similar topics

2
22705
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 result to come out of it as I am using a while loop on a cursor set to retrieve one single tuple. Please be nice, it is my first day seeing cursors ;-)
1
4876
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 key that was created and then writes that and other info to a separate table. This procedure was working fine at our ISP under NT 4 and SQL 7. We recently moved to another ISP on servers that are windows 2000 and SQL 2000. Now this code is...
2
3631
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 strings. I am having issues retrieving these strings from my C++ client. My C# code looks like this: public object DataItems { get
7
16703
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 database is like this...
1
1482
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 side............
2
1790
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 database and store it in array. I need urgently ,Please help me.
20
24169
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 database and store it in array. I need urgently ,Please help me.
5
3220
by: meeanji | last post by:
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
3
2464
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 js with settimeout fn . How do i pass the values from db to js function.
0
8345
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8858
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8771
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8548
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7371
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5657
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4182
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2763
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1757
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.