WHYISNT THIS MYSQL STATEMNT NOT WORKING? (php)


Posted on 16th Feb 2014 07:03 pm by admin

caps because its absolutely rediculous.
i dontunderstand why its not working. there is a column called id and a collumn called to
then there is also. two rows with the field for `to` equal to the number: 1
still doesnt work:
Did you know?Explore Trending and Topic pages for more stories like this.
just outputs . this user has no commnets, none. (every single time)

Code: <?php $testlll = mysql_query("SELECT to FROM cmnts WHERE to = 1");
if(!$testlll){echo "this user has no comments, none.";} else{echo "this user has $testlll comments";} echo $testlll; ?>
and of course $testlll (which i renamed trying to fix it -from $test) is equal to, well. NOTHING!!! whats going on here? do i have to change a table name or something?
i didnt try that because i would have to redo the whole table. theres only one column called to and one column called id (so no dupes)
also im not dumb it used to be $testlll = mysql_num_rows(mysql_query thing but that didnt work either
No comments posted yet

Your Answer:

Login to answer
172 Like 10 Dislike
Previous forums Next forums
Other forums

Passing Variables
What I'm wanting to do is when the user clicks on Arenas it will know the name of the country it's w

Something like an INI editor or a DelimitedText-Editor
Hi all,

Am very, very, very new to PHP and not sure if I should be posting this to a Javascri

JSON SORT WITH PHP
I have two products that I want to sort by say "Id:17, value: xxx" using php
The page w

Code error with Index.php
Error: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/runevid/public_

Custom CMS
This is a big custom CMS script I'd like to develop and would like some help atleast figuring out wh

Echo-ing MySQL content and Keep Formatting?
I have data in my MySQL such as:

QuoteBlah blah

Blah blah

etc
but when i ech

Ariba 9r - SAP MM Integration
Hi experts,

The standard Ariba adapter for 9r creates a relationship between Cost Centers

Need help making a blockquote and line items conditional
I have some code I bought a few years ago that allows my clients to update content on their site usi

help with multi-update
Now sure how to ask this really....
10g database if that matters.

I have a customer

PHP friend keyword equivalent
is there a PHP equivalent for the C++ friend keyword?

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash