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

Wht does this error mean ?

i keep getting these type of messages how do i fix them ?
mysql_num_rows() is not a my sql function
mysql_num_array() is not a my sql function


Please help .
Sep 15 '07 #1
5 2785
bartonc
6,596 Expert 4TB
i keep getting these type of messages how do i fix them ?
mysql_num_rows() is not a my sql function
mysql_num_array() is not a my sql function


Please help .
Since that doesn't look like an error that MySql would output, you'll need to tell us what programming language that you are using and what means you have of connecting to the database.

If the IS an error cause by a SQL query, then perhaps you will have better luck by posting in the MySQL Forum.
Sep 15 '07 #2
pbmods
5,821 Expert 4TB
Heya, Rathour. Welcome to TSDN!

Is PHP complaining about a 'Call to undefined function mysql_num_rows()'?
Sep 15 '07 #3
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\Program Files\xampp\htdocs\Alam_project\login.php on line 6


This is the error i get with this file :::::::
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. session_start();
  3. $con=mysql_connect("localhost","root","");
  4. $db=mysql_select_db("alam1",$con);
  5. $rs=mysql_query("select userid,password from newuser where userid='".$_POST["txtuid"]."' and password='".$_POST["txtpass"]."'");
  6. if(mysql_num_rows($rs)<=0)
  7.  
  8. {
  9. $_SESSION["msg"]="<b><font color=red>Invallid Userid or Password</font></b>";
  10. }
  11. else
  12. {
  13. unset($_SESSION["msg"]);
  14. $rows=mysql_fetch_array($rs);
  15. $id=$rows["userid"];
  16. //header("Location:user_profile_signin.php?id=".$id);
  17. }
  18. ?>
  19. <!--/*$query="SELECT detail, inrepret from menu";
  20. $result=mysql_query($query); 
  21. $num_results=mysql_num_rows($result); 
  22. for ($c=0;$c<$num_results;$c++)
  23. {
  24. $relevancy=0;
  25. $row=mysql_fetch_object($result);
  26. $mypage=$row->number;
  27. $mycontent=strtolower(strip_tags($row->article)); 
  28. for ($d=0; $d<$q_num; $d++)
  29. {*/-->
  30.  
tell me wht needs to be fixed here ?
Sep 17 '07 #4
pbmods
5,821 Expert 4TB
Heya, Rathour.

First thing I fixed for you:
Please use CODE tags when posting source code:

[CODE=php]
PHP code goes here.
[/CODE]

Now then, you're likely getting this error because your MySQL query is generating an error. Try adding this line after your mysql_query():
Expand|Select|Wrap|Line Numbers
  1. echo mysql_error();
  2.  
Sep 17 '07 #5
epots9
1,351 Expert 1GB
you error is in this line
[php]
$rs=mysql_query("select userid,password from newuser where userid='".$_POST["txtuid"]."' and password='".$_POST["txtpass"]."'");
[/php]

since userid would be a number you don't enclose it with single quotes as if it were a string (varchar). so it would be like:

[php]
$rs=mysql_query("select userid,password from newuser where userid=".$_POST["txtuid"]." and password='".$_POST["txtpass"]."';");
[/php]

now it should run fine.
Sep 17 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: lkrubner | last post by:
I want to give users the power to edit files from an easy interface, so I create a form and a PHP script called "fileUpdate". It does a reasonable about of error checking and prints out some...
6
by: WindAndWaves | last post by:
Hi Folks I have inhereted a script that I understand reasonably well, I just do not understand !/^\d+$/.test(el.value) what the hell does that mean? Below is the script (there are really...
13
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
4
by: geodev | last post by:
I have developed a small application using ASP.NET and VB.NET on my development machine it works great. When I copy across the files manually to my test machine and create a Virtual Directory all...
1
by: John Ramsden | last post by:
I have ported a PHP MySQL app to PostgreSQL, and a pg_send_query() call is returning error code 2 (PGSQL_TUPLES_OK). Unfortunately the PHP manual lists the error codes but doesn't indicate what...
15
by: Pucca | last post by:
I'm getting an error when I tried to use this BerConverter class in my C# code. Even though the Interent doc says that it runs on Win2000 sp4, I just thgouth I'll double check. Does anyone know...
13
by: Protoman | last post by:
I'm getting an error: 10 C:\Dev-Cpp\Enigma.cpp no match for 'operator<' in 'i < (+cleartext)->std::basic_string<_CharT, _Traits, _Alloc>::end ()' Code: Enigma.hpp...
5
by: prabu | last post by:
Hi all, I want to know, what does the value of the array in the following statement mean and How to print the content of the array SMB_Negotiate using printf? unsigned char SMB_Negotiate = ...
4
by: liyanage | last post by:
I recently worked on error handling and three related issues/questions came up. 1.) I am trying to trigger Apache ErrorDocument handlers by setting appropriate HTTP status codes in my PHP...
6
by: Bint | last post by:
I'm getting this returned from a PHP script. What does this mean? <b>Parse error</b>: syntax error, unexpected ')', expecting T_PAAMAYIM_NEKUDOTAYIM in <b>/ho Thanks B
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.