Wrox Programmer Forums
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 17th, 2005, 02:09 PM
Authorized User
 
Join Date: Jan 2004
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Ashleek007
Default record display

$query = "SELECT * FROM FWnews";
$result = mysql_query($query);
$count = 0;

while($row1 = mysql_fetch_array($result,MYSQL_ASSOC))
{
$counter = $count++;
$newstitle.$counter = $row1[newstitle];
}

echo $newstitle1;

The idea i want is to be able to select the first, second and third records from the table 'FWnews' and enter the values in separate variables???

There is a field 'newsID' which increments by one every time a new record is created

The code is the way i was thinking, but it dont work, is there another way??

cheers
Ash;)

My new web design domain
www.askmultimedia.co.uk
__________________
My new web design domain
www.askmultimedia.co.uk
 
Old July 22nd, 2005, 01:40 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default


Use Arrays like $newtitle[]= ..

http://www.mediasworks.com/tutorial/






Similar Threads
Thread Thread Starter Forum Replies Last Post
Display Deleted record name Makepeace1 Classic ASP Databases 7 May 20th, 2008 10:20 AM
How do you display first record of a field only saf01 Crystal Reports 1 November 7th, 2005 07:49 AM
Display one database record Mikej00 Classic ASP Databases 1 December 1st, 2004 07:14 AM
can't display record from table. jenjenyan Access ASP 3 June 5th, 2004 12:36 AM
Display a single record.. PLEASE HELP TnTandyO Classic ASP Databases 26 September 9th, 2003 10:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.