Can't see a problem with this code.

I'm getting the following error from this code:

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/mrbreeze/public_html/Walk_Map_Display.php on line 524

The code in question is as follows:

                              $SqlString2 = "SELECT * FROM survey_data WHERE
                              SEQ LIKE ".$ROW['SEQ'];
                              echo "String = ".$SqlString2."<br>";
                              
                              $Survey_Data = mysql_query($SqlString2);
                              $count = mysql_num_rows($Survey_Data);
                              echo "Count = ".$count."<br>";

I'm having a bad day.  The query is correct and returns 3 records.
breeze351Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hieloCommented:
>>mysql_num_rows() expects parameter 1 to be resource, boolean given
That means that the query failed.  mysql_error() will tell you the reason for it.

Did you intend to do an "equal" query:
 $SqlString2 = "SELECT * FROM `survey_data` WHERE 
                              `SEQ`='" . mysql_real_escape_string($ROW['SEQ']) . "'";
                              echo "String = ".$SqlString2."<br>";
                              
                              $Survey_Data = mysql_query($SqlString2) or die( mysql_error() );
                              $count = mysql_num_rows($Survey_Data);
                              echo "Count = ".$count."<br>";

Open in new window

As opposed to a LIKE query (which typically includes a 'wildcard' -- LIKE 'S%':
 $SqlString2 = "SELECT * FROM `survey_data` WHERE 
                              `SEQ` LIKE '" . mysql_real_escape_string($ROW['SEQ']) . "%'";
                              echo "String = ".$SqlString2."<br>";
                              
                              $Survey_Data = mysql_query($SqlString2) or die( mysql_error() );
                              $count = mysql_num_rows($Survey_Data);
                              echo "Count = ".$count."<br>";

Open in new window

0
Ray PaseurCommented:
You will have to get off MySQL soon -- PHP is doing away with MySQL support.  This article tells why and shows what you must do to keep your scripts running in the future.  It also shows how to get the error information from MySQL, MySQLi and PDO extensions.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/PHP_Databases/A_11177-PHP-MySQL-Deprecated-as-of-PHP-5-5-0.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.