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:
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

$_FILES array
Ok,

I just started experimenting with PHP today. My goal right now is to have people be able

weird problem
last time, i did post a topic concerning why my page sometime will load as blank page when using IE.

PHP switch function help
Hi, I am trying to create a search function for a directory website. On the search function on html

Linkage between two scripts
Okay say I have this for a link in a script:

Code: <li><a href="#&q

PHP url branch??
Functionally, using PHP, I'm doing a test of login input submitted by a user via an html form in a f

Automatically Detect Phone Model for WAP Jar Deployment
Making a wap site is fairly simple, but I'd like to know if there's a way to make it so that the wap

PHP If Else statement for breadcrumb
Hi

I am trying to use a PHP if else statement to display a breadcrumb link on wordpress

How to use php and sql to check if values match the ones in a table (for logins)
How would I code it that the script takes two variables that are passed to it (UserID and PIN), and

Ajax Issues - Update Panel / Timer. Intellisense doesn't know about them
Type 'System.Web.UI.ScriptManager' does not have a public property named 'UpdatePanel'. That is wha

Delete records not in top 15
Hi,

I'm creating a hall of fame page in my game and the page will only display the top 15 sco

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