473,406 Members | 2,707 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,406 software developers and data experts.

line missing


hallow

why won't this code let me show the first line on my db

mysql_connect("localhost", "mysql_user", "mysql_password") or
die("Could not connect: " . mysql_error());
mysql_select_db("mydb");

$result = mysql_query("SELECT id, name FROM mytable");

while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
printf("ID: %s Name: %s", $row[0], $row[1]);
}

i have 3 lines in my db and it shows me 2
i hope someone can help me out.

thank jou verry much
Jul 17 '05 #1
4 1539
"Gurk" <gu******@hotmail.com> wrote in message
news:41**********************@news.skynet.be...

hallow

why won't this code let me show the first line on my db

mysql_connect("localhost", "mysql_user", "mysql_password") or
die("Could not connect: " . mysql_error());
mysql_select_db("mydb");

$result = mysql_query("SELECT id, name FROM mytable");

while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
printf("ID: %s Name: %s", $row[0], $row[1]);
}

i have 3 lines in my db and it shows me 2
i hope someone can help me out.


$result = mysql_query("SELECT id , name FROM mytable");
if(! $result || mysql_error() || mysql_num_rows($result) < 1)
{
echo "Unable to fetch records!"
}
else
{
printf("%s rows found<br>\n" ,mysql_num_rows($result));
while($row = mysql_fetch_array($result , MYSQL_NUM))
{
printf("ID: %s Name: %s<br>\n", $row[0], $row[1]);
}
}
Jul 17 '05 #2
indees it says howmuch lines there are, but it won't dis play the values of
the first line.
it begins displaying at the second line, but he knows there is a first

how commes?

"CJ Llewellyn" <in*****@example.con> wrote in message
news:ch**********@slavica.ukpost.com...
"Gurk" <gu******@hotmail.com> wrote in message
news:41**********************@news.skynet.be...

hallow

why won't this code let me show the first line on my db

mysql_connect("localhost", "mysql_user", "mysql_password") or
die("Could not connect: " . mysql_error());
mysql_select_db("mydb");

$result = mysql_query("SELECT id, name FROM mytable");

while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
printf("ID: %s Name: %s", $row[0], $row[1]);
}

i have 3 lines in my db and it shows me 2
i hope someone can help me out.


$result = mysql_query("SELECT id , name FROM mytable");
if(! $result || mysql_error() || mysql_num_rows($result) < 1)
{
echo "Unable to fetch records!"
}
else
{
printf("%s rows found<br>\n" ,mysql_num_rows($result));
while($row = mysql_fetch_array($result , MYSQL_NUM))
{
printf("ID: %s Name: %s<br>\n", $row[0], $row[1]);
}
}

Jul 17 '05 #3
In article <41**********************@news.skynet.be>, Gurk wrote:
indees it says howmuch lines there are, but it won't dis play the values of
the first line.
it begins displaying at the second line, but he knows there is a first

A database doesn't know about "lines".

My guess is that the first row, contains values that are NULL or ''
--
Tim Van Wassenhove <http://home.mysth.be/~timvw>
Jul 17 '05 #4
"Gurk" <gu******@hotmail.com> wrote in message
news:41**********************@news.skynet.be...
indees it says howmuch lines there are, but it won't dis play the values of the first line.
it begins displaying at the second line, but he knows there is a first

how commes?


No idea, try

print_r($row) inside <pre> tags

Jul 17 '05 #5

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

Similar topics

19
by: gsb | last post by:
HOW TO: Submit a form to PHP with no return? I need to submit a form for file upload to a PHP script but do not want anything returned. That is the TARGET for the form should be like a null...
7
by: j. smith | last post by:
Hi, I need your help! Why does Borland Builder says E2293 ) expected at line 210 when using the fellowing line: virtual void Parse(const TCHAR* szValue) = 0;
40
by: Abby | last post by:
My .dat file will contain information like below. /////////// First 0x04 0x05 0x06 Second 0x07
8
by: Dawn Minnis | last post by:
Hey guys If I have a program (see codeSnippet1) that I compile to be called test.o Then run it as test.o n n 2 3 4 I want the code to be able to strip out the two characters at the start...
7
by: DemonWasp | last post by:
I've been having some trouble getting the Scanner class to operate the way I'd like. I'm doing some fairly basic file IO and I can't seem to get the class to load the last line/token any way I try....
0
by: sramsey | last post by:
I have been using Lebans ReportToPDF code for a couple months without problems. We recently changed the format of the invoice and now the first line of the detail section of my report is missing 2...
6
by: ldn95887 | last post by:
I have been using Lebans ReportToPDF code for a couple months without problems. We recently changed the format of the invoice and now the first line of the detail section of my report is missing 2...
7
by: Greg | last post by:
Visual Studio - Line numbers missing from error list I'm writing an app in ASP.NET using VS 2005. There are no line numbers with the build errors reported. Any suggestions? I can't find any...
3
by: KW | last post by:
Has anyone had a problem with the resulting PDF output using Stephan Leban's ConvertReportToPDF missing the first line of the report being converted. Sometimes it works, sometimes the 1st line of...
5
by: IdleBrain | last post by:
I am trying to log the Application name, Method name, line number and column number whenever an exception is generated in an C# 2005 application using the following code. Problem is that the...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
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.