•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 403,029 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 2,866 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: 458 | Replies: 13 | Solved
![]() |
•
•
Join Date: Apr 2008
Posts: 31
Reputation:
Rep Power: 1
Solved Threads: 0
almost there only problem is it displays like this???
Array ( [0] => 7 [intnewsID] => 7 [1] => [intAccountID] => [2] => Ecuador offers to buy out oil companies [newsshTit] => Ecuador offers to buy out oil companies [3] => Ecuador offers to buy out oil companies [newsTit] => Ecuador offers to buy out oil companies [4] => Sat May 17, 7:32 PM ET President Rafael Correa says Ecuador wants to buy out private oil companies unwilling to negotiate new deals with his government. Correa has asked companies now suing over an October decree that slashed their share of windfall oil profits to 1 percent to drop their lawsuits. Ecuador on Friday offered to boost those companies' share of soaring windfall profits to 30 percent. If companies aren't happy with that offer, Correa says his government will buy their assets at "a fair price." France's Perenco Gabon SA, U.S.-based Murphy Oil Corporation and ConocoPhillips-subsidiary Burlington Resources are among those to file claims against Ecuador. Windfall profits are unexpected earnings on oil sold for more than the price fixed in a company's contract. [newsMn] => Sat May 17, 7:32 PM ET President Rafael Correa says Ecuador wants to buy out private oil companies unwilling to negotiate new deals with his government. Correa has asked companies now suing over an October decree that slashed their share of windfall oil profits to 1 percent to drop their lawsuits. Ecuador on Friday offered to boost those companies' share of soaring windfall profits to 30 percent. If companies aren't happy with that offer, Correa says his government will buy their assets at "a fair price." France's Perenco Gabon SA, U.S.-based Murphy Oil Corporation and ConocoPhillips-subsidiary Burlington Resources are among those to file claims against Ecuador. Windfall profits are unexpected earnings on oil sold for more than the price fixed in a company's contract. [5] => 2008-05-18 [dtAddedOn] => 2008-05-18 )
•
•
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation:
Rep Power: 8
Solved Threads: 239
Yes. It displays everything it fetches for that particular id. You can limit your output by choosing what to print. As you can see, $row is an array. $row['intnewsID'] will have 7, $row['newsTit'] will have "Ecuador offers to buy out oil companies" and so on.. Check this out.
http://nl3.php.net/mysql_fetch_array
This is how you can print only newsTit value.
http://nl3.php.net/mysql_fetch_array
This is how you can print only newsTit value.
php Syntax (Toggle Plain Text)
//news.php //db connection $id = mysql_real_escape_string($_GET['id']); $query = "select * from newstable where id = '$id'"; $result = mysql_query($query); $row = mysql_fetch_array($result); print $row['newsTit']; ?>
Last edited by nav33n : May 19th, 2008 at 10:20 am.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
*PM asking for help will be ignored*
*PM asking for help will be ignored*
![]() |
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
age amd avatar blue gene business chips database development dos economy energy enterprise environment hardware ibm ibm. news intel ibm it linux medicine memory messaging microsoft myspace news office open source openoffice pc post to ps3 recession red hat remote working russia security sex sun supercomputer supercomputing technology trends ubuntu working x86
Other Threads in the PHP Forum
- Previous Thread: Multiple PoPup
- Next Thread: PHP and Oracle connection



Linear Mode