Re: Mysql num rows(): Invalid argument Programming Web Development by Troy … use to create your tables--right? For many people with MySql, that tool is phpMyAdmin. Do you have access to use… a valid statement, but it does not return any rows because no rows match the query. Once you work through this part… MySQL Num Rows Inside a Loop Programming Web Development by BlueCharge … will be in a new row so there are multiple rows per person. I am trying to use the following code… Re: MySQL Num Rows Inside a Loop Programming Web Development by boorsekala … to repair in some times in day. to speed up mysql. Re: MySQL num rows error Programming Databases by missaaliyah …your query. Print the query, execute it in mysql console or phpmyadmin. (Also post it here) …results were. Tested: $total=mysql_num_rows($return); [icode] MySQL said: #1064 - You have an error in …mysql_num_rows($return); $sess_id="PHPSESSID=".session_id(); [icode] MySQL said: Documentation #1064 - You have an error in… MySQL num rows error Programming Databases by missaaliyah I have very limited use of using MySql - but I am trying to fix this code and it … site. [icode]Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/imedia/public_html/uk-webdirectory.info/admin… Re: MySQL num rows error Programming Databases by nav33n The error is because there is something wrong in your query. Print the query, execute it in mysql console or phpmyadmin. (Also post it here) :) Re: MySQL num rows error Programming Databases by missaaliyah It's reply is practically the same as before I think. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '$query="SELECT * FROM dir_site_list WHERE site_sponsor='N' AND site_live='Y' ORD' at line 1 Mysql num rows(): Invalid argument Programming Web Development by Yuki H. Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/user/public_html/im2db/image.php on … Re: Mysql num rows(): Invalid argument Programming Web Development by Troy For your mysql error, test your SQL statement. Right after your line that … Re: MySQL Num Rows Inside a Loop Programming Web Development by hielo On line 7, you forgot to execute the query. You need to use mysql_query(): [CODE] ... $selectcount = mysql_query("SELECT * FROM refferals WHERE refferer = '$current'") or die( mysql_error() ); ... [/CODE] Re: MySQL Num Rows Inside a Loop Programming Web Development by hielo try: [CODE] <?php include("includes/db_connect.php"); $result = mysql_query("SELECT `refferer`, COUNT(refferer) as `total` FROM refferals GROUP BY `refferer`") or die(sprintf('Line: %s <br>$s',__LINE__.mysql_error())); while($row = mysql_fetch_assoc($result)) { echo sprintf('%s | %s', $row['refferer'], $row['… Re: MySQL Num Rows Inside a Loop Programming Web Development by rajarajan2017 [CODE] $query = ("SELECT * FROM refferals WHERE refferer = '$current'"; $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); $fetchall = mysql_num_rows($result); [/CODE] Re: MySQL Num Rows Inside a Loop Programming Web Development by BlueCharge Thank you all for your replies, particularly hielo. It's now counting and working and the list is below, but i dont want to list the same user more than once... PLease help: [QUOTE]opticl3gendz | 1 Mase93 | 1 JVLattyxD | 2 JVLaTTyxD | 2 JVLatty xD | 3 HandLegements | 1 dazzarfc12 | 5 dazzarfc12 | 5 dazzarfc12 | 5 dazzarfc12 | 5 JVLaTTy | 1 … Re: MySQL Num Rows Inside a Loop Programming Web Development by rajarajan2017 Use distinct keyword to filter a single record as like below sample query [CODE]SELECT distinct PRODUCT_LinE FROM mytable ORDER BY PRODUCT_LinE ;[/CODE] Re: MySQL Num Rows Inside a Loop Programming Web Development by hielo [QUOTE]It's now counting and working and the list is below[/QUOTE] Based on that result, I suspect you opted to apply the fix on my first post. Try my second post. It's a complete re-write of your code. It should do what you are after. Re: MySQL num rows error Programming Databases by Shanti C change this : $return=mysql_query($query,$link); to: $return=mysql_query($query); Re: MySQL num rows error Programming Databases by nav33n [QUOTE=Shanti Chepuru;654919]change this : $return=mysql_query($query,$link); to: $return=mysql_query($query);[/QUOTE] That definitely wouldn't matter. Thats because [url=http://in.php.net/mysql_query] mysql_query [/url] can take an optional parameter of link identifier (the variable used to 'open' the connection). Re: MySQL num rows error Programming Databases by Shanti C k...nav... thanks for indiacating........ Re: MySQL num rows error Programming Databases by nav33n [code=php] $query="SELECT * FROM dir_site_list WHERE site_sponsor='N' AND site_live='Y' ORDER BY site_id LIMIT $start,$limit"; echo $query; [/code] Tell us what it prints. Re: MySQL num rows error Programming Databases by nav33n Can you post your updated code ? [icode]echo $query; [/icode] should print out the query. But anyway, post your complete code. Re: MySQL num rows error Programming Databases by missaaliyah What do you mean by updated code? Also I am confused about print out the query, do you mean its response to the query I run in phpmyadmin? Did you want me to post the whole page? Re: MySQL num rows error Programming Databases by nav33n Umm.. Post the whole page.. I ll tell you what to do next.. Re: MySQL num rows error Programming Databases by missaaliyah [code=language]<?php ini_set("max_execution_time", "30000"); # choose a banner include_once('../includes/db_connect.php'); ?> <?php ini_set("max_execution_time", "30000"); session_start(); # remove members from the mailing list when they click from within the newsletter check_admin… Re: MySQL num rows error Programming Databases by nav33n Okay.. You have some errors in your script. 1. [quote] SELECT * FROM dir_site_list WHERE site_sponsor='N' AND site_live='Y' ORDER BY site_id LIMIT , [/quote] When you execute the script for the 1st time, no LIMIT is set. That is, $start and $limit will be empty. Thats the reason you are getting the error. 2. There has to be a whitespace between … Re: MySQL num rows error Programming Databases by missaaliyah [QUOTE=nav33n;655162]Okay.. You have some errors in your script. 1. When you execute the script for the 1st time, no LIMIT is set. That is, $start and $limit will be empty. Thats the reason you are getting the error. 2. There has to be a whitespace between site_live='Y' and ORDER in the query 3. Since you aren't assigning or calculating $… Re: MySQL num rows error Programming Databases by nav33n You can initialise $start and $limit value. Try the following script. If it works, then, Yay! If it doesn't, then you can post your question in php forum. There are many people who loves to write scripts ! You might get help from any one of them! [code=php] <?php ini_set("max_execution_time", "30000"); # choose a banner … Re: MySQL num rows error Programming Databases by missaaliyah Thank you very much for all your help and support, the code works perfectly. I will definitely be giving you more reputation later. :) Re: MySQL num rows error Programming Databases by nav33n Great! :) Re: MySQL num rows error Programming Databases by rigo1211 hi guys, whats the meaning of this error in my search.php form? Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\xampplite\htdocs\search1.php on line 52 Re: Mysql num rows(): Invalid argument Programming Web Development by Yuki H. I do not get "Try running it directly against your database using phpMyAdmin or the command line client." When I add if ($_FILES['userfile']['error'] == 0) { I get: Warning: fread(): supplied argument is not a valid stream resource in /home/user/public_html/im2db/index.php on line 19 as an error but now it is visible once I go on …