Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

mysql_fetch_row wrong parameter count

Posted on 2010-09-06
5
Medium Priority
?
707 Views
Last Modified: 2012-05-10
My code works when using it in windows but not in linux

I checked the mysql version the one in windows = MySQL client version: 5.1.41
The one in linux = MySQL client version: 5.0.67

In windows it fills all the values as it should
In linux the fields remain empty

If i remove the second parameter then the warning is gone but then it does not work in windows anymore either

This is the actual error:
Wrong parameter count for mysql_fetch_row() in /public_html/_test/profile.php on line 22

See the attached code that results in the error

Anyone know why this happens?

Regards
// Zet het resultaat in een variabele
$row=mysql_fetch_row($result,MYSQL_ASSOC);

Open in new window

0
Comment
Question by:PeterdeB
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 total points
ID: 33611569
http://php.net/manual/en/function.mysql-fetch-row.php


--so, you either want:
$row=mysql_fetch_row($result);

-- or you want:
$row=mysql_fetch_assoc($result);

Open in new window

0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 33611571
the second argument you tried is used in mysql_fetch_array:
http://php.net/manual/en/function.mysql-fetch-array.php
0
 
LVL 15

Expert Comment

by:gplana
ID: 33611601
Just a point: do you really need the number of rows prior to get the results ? If you want just the number of rows, have you considered to make a "SELECT count(*)" statement ?
0
 

Author Comment

by:PeterdeB
ID: 33611654
I did study the [ link to the ] function, but could not make it work, yours works at once angelll

@One question though, why did the false declaration work in windows? Was that because of the difference in version?

@Qplana i just needed the result of one row, i had been busy with the select * count code for all of this morning but could not get it to work, so im glad this one works now, though it might not be the best solution
0
 

Author Closing Comment

by:PeterdeB
ID: 33611675
Thanks for your fast and to-the-point answer, forgive me for my newbie answers, im new to this
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question