473,394 Members | 1,739 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,394 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 1283
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.