php warning: mysql_fetch_row()

Posted on 2014-12-01
Last Modified: 2014-12-01
I have no idea if someone can help me with this or not but since my programmer is gone for 24hrs, I need to ask someone.

I am seeing the following error in the apache logs;

PHP Warning:  mysql_fetch_row() expects parameter 1 to be resource, string given in app.php on line 103

Line 103 is;

$select = mysql_fetch_row($query);
Question by:projects
LVL 36

Accepted Solution

Loganathan Natarajan earned 125 total points
ID: 40474193
Check before this line whether you've execute the query with result. Example,

Author Comment

ID: 40474199
The line before that is;

$result = execQuery($dbconn,$query);

Your example link doesn't seem to lead to anything.
LVL 58

Assisted Solution

Gary earned 250 total points
ID: 40474208
Means the query failed so there are no rows to fetch
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.


Author Comment

ID: 40474215
So it's just a warning, nothing to be concerned about? Or, does it possibly mean it is not finding the data?
LVL 83

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 125 total points
ID: 40474217

Author Comment

ID: 40474222
Ok, so it looks like the programmer just missed this because everything else is using mysqli.
He just needs to update this then.
LVL 58

Assisted Solution

Gary earned 250 total points
ID: 40474225
Not really a warning, when executing the query something went wrong i.e. your sql is wrong

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MySQL left join performance 4 30
Query Peformance + mulitple query plans 9 48
xampp tool 12 30
Sql Query: need to find records in table_a with no matches in table_b 14 30
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Internet Business Fax to Email Made Easy - With  eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

863 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now