/    Sign up×
Community /Pin to ProfileBookmark

array question

hi,

I have this php script:

[code=php]

while($row5 = mysql_fetch_array($result5)) {
$gs = ($row5[“geschiedenis”]);

[/code]

is there a possibility to get a certain line from the array?? Something like the fifth line of
$gs = ($row5[“geschiedenis”]);

i thought of somethinglike:
$gs = ($row5[“geschiedenis”,5]);

but that didn’t work can somenone help me??
thanks in advance

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@jdorfJan 11.2005 — What is returned when you echo $row5["geschiedenis"] ? We need more information about what you're working with to help you.
Copy linkTweet thisAlerts:
@cyber1Jan 11.2005 — [code=php]$row5 = array("item1","item2","item3");
print ($row5[0]);
print ($row5[1]);
print ($row5[2]);
[/code]


-Bill
Copy linkTweet thisAlerts:
@NogDogJan 12.2005 — [code=php]
$result = mysql_query($queryString);
# move result pointer to row 5 (first row is 0):
if(mysql_data_seek($result, 4))
{
$row5 = mysql_fetch_array($result);
}
else
{
echo "ERROR: query only returned " . mysql_num_rows($result) . " rows.";
}
[/code]
×

Success!

Help @zebdaag spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.11,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...