•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 373,098 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,870 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 289 | Replies: 5
![]() |
•
•
Join Date: Jul 2007
Posts: 94
Reputation:
Rep Power: 2
Solved Threads: 2
HI
CAN ANYONE SEE Y THIS IS ECHOING OUT TWICE THE AMOUNTS OF EACH FIELD IN MY DATABASE???
MUCH APPRECIATED
CAN ANYONE SEE Y THIS IS ECHOING OUT TWICE THE AMOUNTS OF EACH FIELD IN MY DATABASE???
PHP Syntax (Toggle Plain Text)
<?php $count = 0; $data = array(); $query = "SELECT * FROM profile WHERE ID = '1' "; $result = MYSQL_QUERY($query); $line = mysql_fetch_array($result); foreach ($line as $col_value) { $data[$count] = $col_value; echo $data[$count]; $count++ ; };
MUCH APPRECIATED
Last edited by peter_budo : Mar 22nd, 2008 at 4:48 pm. Reason: Keep It Organized - please use [code] tags
•
•
Join Date: Nov 2007
Posts: 86
Reputation:
Rep Power: 1
Solved Threads: 6
hmmm,
first off, I don't know why your code isn't throwing an error to begin with.
you have an extra ";" at the end there... once you end a function } you don't need to use a ;
I think your problem might be the $count++ but I can't be 100 p on that.
also put a . before the = in your foreach statement and I think that does what you are trying to do.
Sage
first off, I don't know why your code isn't throwing an error to begin with.
you have an extra ";" at the end there... once you end a function } you don't need to use a ;
I think your problem might be the $count++ but I can't be 100 p on that.
also put a . before the = in your foreach statement and I think that does what you are trying to do.
$query = "SELECT * FROM profile WHERE ID = '1' ";
$result = MYSQL_QUERY($query);
$line = mysql_fetch_array($result);
foreach ($line as $col_value) {
$data[$count] .= $col_value;
echo $data[$count];
}Sage
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,024
Reputation:
Rep Power: 8
Solved Threads: 227
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
Other Threads in the PHP Forum
- Previous Thread: adding name 2login
- Next Thread: PHP-MySQL connection error



Linear Mode