473,411 Members | 1,980 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

Problem with while

I am doing the following statement to retrieve results:

$response = mysql_query("select * from preguntas where tema=$tema",
$db);
$row = mysql_fetch_array($response);
while($row = mysql_fetch_array($response))
{
echo('<font face="Tahoma" size="2">');
echo('<p align="left">');
echo($f .'- <a href="respuestas.php?id='. $row[id]. '">'
..$row[pregunta]. '</a>');
$f++;
}

I receive 2 items as a result. But if I check inside the DB, the result
should be 3 items....I am loosing the first record.

Any ideas about what could be wrong?

Regards,

Ezequiel

Jan 25 '07 #1
1 1284
zek2005 wrote:
I am doing the following statement to retrieve results:

$response = mysql_query("select * from preguntas where tema=$tema",
$db);
$row = mysql_fetch_array($response);
This fetches the first row
while($row = mysql_fetch_array($response))
This fetches the second (and subsequent) rows, throwing away the results
of the first (and previous) rows.
{
echo('<font face="Tahoma" size="2">');
echo('<p align="left">');
echo($f .'- <a href="respuestas.php?id='. $row[id]. '">'
.$row[pregunta]. '</a>');
$f++;
}

I receive 2 items as a result. But if I check inside the DB, the result
should be 3 items....I am loosing the first record.

Any ideas about what could be wrong?

Regards,

Ezequiel
Get rid of the first

$row = mysql_fetch_array($response);
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jan 25 '07 #2

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

Similar topics

45
by: Joh | last post by:
hello, i'm trying to understand how i could build following consecutive sets from a root one using generator : l = would like to produce : , , , ,
1
by: sajidazmi | last post by:
Hi, I'm coding an Stock Order Entry System. The problem I'm facing is when I'm passing a pointer to one class, the pointer gets corrupted. I'm not able to see why? Here is the code, please tell...
4
by: gnah | last post by:
Greetings, I hope my problem is easy to fix, I'm pretty new with php - but I am getting weird results with the opendir() function. It may just be a path problem, but I don't see which variable...
11
by: Marcus Jacobs | last post by:
Dear Group I have encountered a problem with fclose and I am wondering if anyone could provide some insight about this problem to me. Currently, I am working on a small personal project that is...
4
by: Madhu Gopinathan | last post by:
Hi All, I am faced with a horrible hang problem. I have a COM exe server that executes some tasks. The task execution manager is a thread that manages the pool of threads, which is 4 per processor....
0
by: Shoveler | last post by:
I've got an odd problem here that I've been beating my head on for days. I've written a class that uses a pre-established connection for communication, meaning I can use this class for a server or...
7
by: Fernando Barsoba | last post by:
Hi, After following the advice received in this list, I have isolated the memory leak problem I am having. I am also using MEMWATCH and I think it is working properly. The program does some...
1
by: sherifbk | last post by:
Problem description ============== - I have 4 clients and 1 server (SQL server) - 3 clients are Monitoring console 1 client is operation console - Monitoring console collects some data from...
0
by: Filemaxor | last post by:
I have gotten my code to be able to allow people to add new text to a .txt document and able to call up files so the user can see whats in it. The problem i'm having is getting the for loop to work...
1
by: Alex Vinokur | last post by:
Hi, I have compilation problem on SUN CC compiler with template while using option -m64 (64-bit addressing model). No problem while using option -m32 (32-bit addressing model) $ CC -V CC:...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.