|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
General - Mysql_num_rows() not working
I keep getting an error that says "Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\projectmanager\upload.php on line 14"
the code is as follows: PHP Code:
I'm not really sure what is wrong, any help would be greatly appreciated. Thanks! |
|
#2
|
||||
|
||||
|
You are not executing the query!!
PHP Code:
__________________
/** * @author EHSANUL HAQUE * @profession Web Application Developer * @location North York, ON, Canada */ |
|
#3
|
|||
|
|||
|
Well, I edited the code so it looks like this:
PHP Code:
but i still get the same error. Am I using the query correctly? |
|
#4
|
||||
|
||||
|
Try to print mysql_error() which will tell you if there's anything wrong with the SQL. As far I think either $_GET['project_id'] or $_SESSION['USERNAME'] is blank. There's one more possibility. I think you "username" field is either a char or varchar type, therefore, you will need quotation in the SQL. Something similar to the following:
PHP Code:
Notice the SINGLE QUOTES username = '".$_SESSION['USERNAME']."' I will suggest, before you go in the query, check if both the username and project_id are not empty. Printing any possible mysql error will help you debug better. PHP Code:
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > General - Mysql_num_rows() not working |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|