473,507 Members | 9,962 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

fetch array function

For the below query:
----------
$res = mysql_query("select * from tableOne where clientID='".
$_GET['getClientId']."'") or die(mysql_error());
if($inf = mysql_fetch_array($res)
-----------------
The return from this ($inf = mysql_fetch_array($res) looks like this:
$inf["firstname"]
$inf["lastname"]
$inf["address"]

I assume this translates to?
0 = firstname
1 = lastname
3 = address
Jul 2 '08 #1
2 1451
On Jul 3, 12:12*am, "tes...@hotmail.com" <tes...@hotmail.comwrote:
For the below query:
----------
$res = mysql_query("select * from tableOne where clientID='".
$_GET['getClientId']."'") or die(mysql_error());
Firstly, you seem to be using user/url input without sanitizing it.
* if($inf = mysql_fetch_array($res)
-----------------
The return from this ($inf = mysql_fetch_array($res) looks like this:
$inf["firstname"]
$inf["lastname"]
$inf["address"]

I assume this translates to?

0 = firstname
1 = lastname
3 = address
mysql_fetch_array can produce zero indexed array, associated array or
both. Default is both.
So I guess in your case you'd get:

$inf = Array(
0 =value
firstname =value
1 =value
lastname =value
2 =value
address =value
)

Jay
Jul 2 '08 #2
On Jul 2, 6:28*pm, JazzyJay <djrumc...@gmail.comwrote:
On Jul 3, 12:12*am, "tes...@hotmail.com" <tes...@hotmail.comwrote:
For the below query:
----------
$res = mysql_query("select * from tableOne where clientID='".
$_GET['getClientId']."'") or die(mysql_error());

Firstly, you seem to be using user/url input without sanitizing it.
* if($inf = mysql_fetch_array($res)
-----------------
The return from this ($inf = mysql_fetch_array($res) looks like this:
$inf["firstname"]
$inf["lastname"]
$inf["address"]
I assume this translates to?
0 = firstname
1 = lastname
3 = address

mysql_fetch_array can produce zero indexed array, associated array or
both. Default is both.
So I guess in your case you'd get:

$inf = Array(
*0 =value
*firstname =value
*1 =value
*lastname =value
*2 =value
*address =value
)

Jay
Thanks Jay!
Jul 2 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2889
by: Rod | last post by:
Hi, I would like to know if there is a similar function with OCI8 (oracle) to this one: mysql_data_seek ? I would like to do twice: while (ocifetch($stmt)) { .... }
2
3625
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...
7
3509
by: Bernard Lebel | last post by:
Hello, I'm stumbled at a serious problem, and quite frankly getting desparate. This is a rather long-winded one so I'll try to get straight to the point. I have this Python program, that...
1
1330
by: Ben Ellis | last post by:
Hello all, I'm wanting to know which method I should use to fetch dynamic XML data. Is it better to use web services or to fetch the data from a dynamic XML file? Either, use a webMethod to...
7
16682
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...
20
24113
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...
1
2799
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 ...
3
2456
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...
1
1808
by: dillipkumar | last post by:
Hi, I have a flat file like: 106|4 |ABC|0000000280| 919886046726| 253436| TP001| 1| 4200| 998607230300| 12345630864|BUNDLE| ACE1| ...
0
7221
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7109
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...
0
7313
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,...
0
7372
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...
1
7029
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...
1
5039
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3190
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...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
411
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...

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.