At 12:40 AM -0500 2/22/11, Gary wrote:
Can someone tell me why this is not working? I do not get an error message,
the results are called and echo'd to screen, the count does not work, I get
a 0 for a result...
$result = mysql_query("SELECT * FROM `counties` WHERE name = 'checked'") or
die(mys
"Daniel Molina Wegener" wrote in message
news:201102220747.11...@coder.cl...
> On Tuesday 22 February 2011,
> "Gary" wrote:
>
>> Can someone tell me why this is not working? I do not get an error
>> message, the results are called and echo'd to screen, the count does not
>> work, I get a 0 for
Thanks for your reply
"Deva" wrote in message
news:aanlktimvycqsi5nejd1lxxaqbqsb+q_onhoc7omgj...@mail.gmail.com...
>I tried your script locally. Its working for me.
>
> On Tue, Feb 22, 2011 at 11:10 AM, Gary wrote:
>
>> Can someone tell me why this is not working? I do not get an error
>> messa
Hello Gary,
Please wrap $i in braces in your variable variable:
if ( isset($_POST["county{$i}"] ) ) {
echo "You have chosen ". $_POST["county{$i}"]." ";
--
With best regards from Ukraine,
Andre
Skype: Francophile
My blog: http://oire.org/menelion (mostly in Russian)
Twitter: http://twitter.com/
On Tuesday 22 February 2011,
"Gary" wrote:
> Can someone tell me why this is not working? I do not get an error
> message, the results are called and echo'd to screen, the count does not
> work, I get a 0 for a result...
Are you sure that the table is called `counties` and not `countries`?
I tried your script locally. Its working for me.
On Tue, Feb 22, 2011 at 11:10 AM, Gary wrote:
> Can someone tell me why this is not working? I do not get an error
> message,
> the results are called and echo'd to screen, the count does not work, I get
> a 0 for a result...
>
>
>
> $result = my
INSERT queries and num_rows just don't go together.
And whatever you've done with mysql_affected_rows() is just some kind
of silly mistake on your part, almost for sure...
On Tue, May 30, 2006 11:28 pm, John Taylor-Johnston wrote:
> How can I get an integer value for mysql_affected_rows()? I g
On Tuesday 28 September 2004 03:15, PHP Junkie wrote:
> In one of my scripts, I'm getting the error:
Use mysql_error() after every call to the mysql_*() functions.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet
[snip]
In one of my scripts, I'm getting the error:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result
resource in /Library/WebServer/Documents/limiteduse.net/dumptoday.php on
line 56
I¹m not clearly sure why. I¹m running PHP5 with mySQL 4 ... Is there a
compatibility issues
Generally you've got an error in your SQL at such points. If you do,
mysql_query return false, and false is nor a valid MySQL result, so
mysql_num_rows errors out.
Check using mysql_error() to see what you're doing wrong
Php Junkie wrote:
Ave,
In one of my scripts, I'm getting the error:
Warning
John Taylor-Johnston wrote:
My question got buried on the bottom of the thread. Sorry for the repeat. I'm getting this message:
Warning: Supplied argument is not a valid MySQL result resource in /.../testals.php on line 189
Read with me. Supplied argument ($news) is not a valid MySQL result
reso
PROTECTED]" <[EMAIL PROTECTED]>
To: "Mike Tuller" <[EMAIL PROTECTED]>; "J J" <[EMAIL PROTECTED]>
Cc: "php mailing list list" <[EMAIL PROTECTED]>
Sent: Friday, April 04, 2003 4:18 PM
Subject: Re: [PHP] mysql_num_rows
> Someone help
Someone helped me out with this to see exactly what the query is
returning...
echo " the Query: "; print_r ($select_result); echo "";
This should show you exactly what the result is getting...
/T
on 4/4/03 4:49 PM, Mike Tuller at [EMAIL PROTECTED] wrote:
> I can't believe I forgot that. time t
I can't believe I forgot that. time to go home for the week.
thanks.
On Friday, April 4, 2003, at 04:28 PM, J J wrote:
oh and your SQL statement is wrong:
SELECT * FROM table WHERE you are missing the
FROM...
--- Mike Tuller <[EMAIL PROTECTED]> wrote:
I can't get mysql_num_rows to work f
> $department_name = $_POST['department_name'];
>
> $select_query = "SELECT * WHERE department_name = '$department_name'";
> $select_result = mysql_query($select_query, $db_connect);
> $select_total_rows = mysql_num_rows($select_result);
>
> if ($select_total_rows<1)
> {
> $insert_query = "
oh and your SQL statement is wrong:
SELECT * FROM table WHERE you are missing the
FROM...
--- Mike Tuller <[EMAIL PROTECTED]> wrote:
> I can't get mysql_num_rows to work for some reason.
> Here is a snippet
> of what I have
>
>
> $department_name = $_POST['department_name'];
>
> $selec
Try:
($select_total_rows == 0)
instead.
That and maybe echo $select_total_rows; to see what
it's returning.
--- Mike Tuller <[EMAIL PROTECTED]> wrote:
> I can't get mysql_num_rows to work for some reason.
> Here is a snippet
> of what I have
>
>
> $department_name = $_POST['departme
And which database are you using?? (hint - mysql_select_db() might be a good
idea ...)
> -Original Message-
> From: Phil Powell [mailto:[EMAIL PROTECTED]]
> > Anyone know why this is happening? I have mySQL on Win2000
> Server with IIS
> > and PHP:
>>
--
PHP General Mailing List (http:/
Are you actually checking that the query result is valid?
$conn = mysql_connect('localhost', "xxx", "yyy") or die('Could not connect
to db');
$result = mysql_query('select * from blah', $conn);
if ($result)
{
echo "Number of rows: " . mysql_num_rows($result);
if (mysql_num_rows($result) > 0)
You query is incorrect. Try doing the same query from the MySQL clent.
|-> -Original Message-
|-> From: Phil Powell [mailto:[EMAIL PROTECTED]]
|-> Sent: Thursday, January 09, 2003 7:46 PM
|-> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
|-> Subject: [PHP] mysql_num_rows() error
|->
|->
|->
> Would someone be kind enough to explain why I'm not getting the correct
> result from the following query. If I select a valid member no. and name,
> the following query should return 1 row. This is not the case, however. It
> returns zero rows.
>
> $sql = "SELECT * FROM users WHERE member_
add
echo mysql_error();
after line 39, it should tell you why the query failed in the future.
Now I can tell you you have a typo:
"slecet" => "select"
empty wrote:
Hi guys;
I have a problem (or mistake(s));
for this code
39| $result=mysql_query("slecet * from site_members where User_Name='
Hi,
> 39| $result=mysql_query("slecet * from site_members where
> User_Name='$username'"); 40| $num_row=mysql_num_rows($result);
> 41| if($num_row>0) echo("error 46");
There is an typo-error in the word "slecet" which shoud look like "select" :-)
-Sascha
--
PHP General Mailing List (htt
I suppose it's nothing to do with the spelling mistake in the sql statement
(slecet should be select)
Mark
-Original Message-
From: empty [mailto:[EMAIL PROTECTED]]
Sent: 21 November 2002 15:57
To: [EMAIL PROTECTED]
Subject: [PHP] mysql_num_rows
Hi guys;
I have a problem (or mistake
Your query on the previous line is failing for one reason or another.
You can use mysql_error() to get the error message from MySQL, or you
can place an echo statement in your code to make sure the SQL
statement is what you think it is.
You can also try the SQL statement yourself interactively at
Well, those error normaly appear when you've got something wrong in your sql
statement. Make sure there is some information stored in your database,
empty tables are sometimes troublesome.
What do you use $link for?
$sql = "select USUARIO from docente where USUARIO = '$usuario'";
$result =
Omar Campos wrote:
> I get the next warning:
> Warning: mysql_num_rows(): supplied argument is not a valid MySQL result
> resource in /home/olimpiad/public_html/base/alta1.php on line 34
This usually means that the SQL query failed. You can check the value
returned by mysql_query to see if this
Hi Nick,
> I am new to php and that the folowing error:
> Warning: mysql_num_rows(): supplied argument
> is not a valid MySQL result resource in
> /home/tbonestu/public_html/smallimages.php
>
> i dont know what i am doing wrong here is the code:
>
> @ $db = mysql_pconnect(connect info);
Alo
>> I am new to php and that the folowing error: Warning:
mysql_num_rows():
>> supplied argument is not a valid MySQL result resource in
>> /home/tbonestu/public_html/smallimages.php
>>
>> i dont know what i am doing wrong here is the code:
>>
>> @ $db = mysql_pconnect(connect info);
>>
>> m
> I am new to php and that the folowing error: Warning:
mysql_num_rows():
> supplied argument is not a valid MySQL result resource in
> /home/tbonestu/public_html/smallimages.php
>
> i dont know what i am doing wrong here is the code:
>
> @ $db = mysql_pconnect(connect info);
>
> mysql_select
Hi,
Sunday, September 23, 2001, 3:25:02 PM, you wrote:
NV> I am new to php and that the folowing error: Warning: mysql_num_rows():
NV> supplied argument is not a valid MySQL result resource in
NV> /home/tbonestu/public_html/smallimages.php
NV> i dont know what i am doing wrong here is the code:
On Thursday 15 August 2002 07:35, Sascha Braun wrote:
> This is my query with some dummy loginformations:
>
> SELECT * FROM benutzer_db where Benutzername = 'Herbert' AND Passwort =
> 'hals'
>
> and this is the code i use for the database transaction:
>
> $Query = "SELECT * FROM benutzer_db where
In your database design you need the following
every username/pass comb is unique.
so a query like ... WHERE username='$testvalue' AND password='$testvalue2'
Have to give you one row for a good user/passcombination ALWAYS. And 0 rows
for a wrong combination.
If NOT your design doesn;t fit you
> $query = "select count(*) from users where "
You are asking for a count() in your query. This will always give you
one row returned with a count. If you really want to do this you should
probably have:
$query = "select count(*) as usercount from users where"
Then you can do your te
At 13:00 18-06-02 +0100, Mark Colvin wrote:
>The function below works when I pass in a valid username and password and
>returns '1'. When I pass a username and password that is not in the database
>it still returns '1'. I have put some echo statements in for debugging and
>the value of $numresult
Try
$query = "select count(*) as Lines from users where "
and then check the value of Lines. Or then do something like
$query = "select ID from users where "
and now your mysql_num_rows($result) should return right kinda value.
Niklas
-Original Message--
It's 1 based. It returns the number of rows. Not the index of the last
row. (Which would be 0 based.)
On Fri, 2002-06-07 at 19:23, William_dw -- Sqlcoders wrote:
> Hiya!,
> Does anyone know whether mysql_num_rows is zero or one based?
>
> that is, if I have 5 records will mysql_num_rows() return
[snip]
Does anyone know whether mysql_num_rows is zero or one based?
[/snip]
It's one based.
Jay
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
At 06:05 AM 2/18/2002 Monday, Frank Miller wrote:
>Next I say if ($num == 0)
>{
> echo " There are no events scheduled today!";
>}
>else
> {
> echo "blah, blah, blah";
>}
Try this
if (empty($num))
echo "Nothing today!";
else
echo "blah, blah, blah";
I belie
-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: 18. helmikuuta 2002 16:27
To: Php-General; ':[EMAIL PROTECTED]'
Subject: RE: [PHP] Mysql_num_rows
Please show your exact code, because your code snippet looks right.
Then, again, maybe it's because
Please show your exact code, because your code snippet looks right.
Then, again, maybe it's because it's an Aggie machine...
-Original Message-
From: Niklas Lampén [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 18, 2002 8:11 AM
To: Php-General
Subject: RE: [PHP] Mysq
Maybe you can round the problem with
if ($num < 1)
echo "Nothing today!";
else
echo "Something to do today!";
if (!isset($num) || $num == 0)...
Niklas
-Original Message-
From: Frank Miller [mailto:[EMAIL PROTECTED]]
Sent: 18. helmikuuta 2002 16:05
To: [EMAIL PROTECTE
42 matches
Mail list logo