User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 401,709 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,066 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 2162 | Replies: 1
Reply
Join Date: Feb 2006
Posts: 1
Reputation: delite is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
delite delite is offline Offline
Newbie Poster

Help mysql_num_rows(): supplied argument is not a valid MySQL result resource in /user/690

  #1  
Feb 17th, 2006
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /data/9/0/24/113/676928/user/690291/htdocs/inc/_up_index1.php on line 40

This is the error i get every time when any of my php scripts try to read/write in my mysql data base.

This is _up_index1.php

[PHP]
<?

$test_act['new_tranzaction']="OK";



$test_act['tranzaction_details_started']="OK";

$test_act['tranzaction_details_pointing']="OK";

$test_act['accept_tranzaction']="OK";

$test_act['reject_tranzaction']="OK";

$test_act['tranzaction_details']="OK";

$test_act['payment']="OK";

if(!$test_act[$act]){

$act="tranzactions";
}



if(session_is_registered("valid_user")){

$act=$act;}

else{

$errormsg="";

if($do=="login"){

$sql="select * from escrow_user where user='$user' and pass=PASSWORD('$pass') LIMIT 1";

$result=mysql_query("$sql");

$n=mysql_num_rows($result); /// LINE 40

if($n==0){

$errormsg="Invalid Log In";

$title="LOG IN";

$act="login";}

else{

$rand=mysql_fetch_array($result);

$valid_user=$user;

$valid_email=$rand[email];

session_register("valid_user");

session_register("valid_email");

$title="your account";

$act=$act;}

}

else{$act="login";

$title="LOG IN";

}

}

?>
[/PHP]

I am a newbie in php so if anyone can help me fix this website it will be highly apreciate.

thanks
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jan 2006
Posts: 29
Reputation: rcasinillo_s is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
rcasinillo_s rcasinillo_s is offline Offline
Light Poster

Re: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /user/690

  #2  
Feb 18th, 2006
Try this im sure it will work...
$sql="select * from escrow_user where user='$user' and pass='$pass' LIMIT 1";
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 8:49 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC