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

simple script won't work. Please help
I'm new to php, and I am having trouble displaying a simple script in my web browser. My php code ex

Better Method of a Member Cloud
I assume most people know how tag clouds work, where the tags most used are bigger and the least use

Passing PHP variables from one page to another
Hello-

I'm having trouble figuring out how to transport a variable from one php file to anoth

Unique Visitor Tracking
Hello. Currently, I run a voting site where voters are tracked by their IP address and can only vote

help, header() is not working!
Hello, I have this code:


<?php

/**
* @author samoi
* @copyright 200

Combining Two Queries
I have two scripts that each work fine by themselves. One is a search script with a variable that de

Connecion issue
Hi,

For some reason, I keep getting this error when trying to connect:

Warning: mysql_

Can anyone give me some link on .htaccess tutorial
i wish to have friendly url using .htaccess, but no idea yet about this

Hope that anyone cou

Allowing ' and "
Hello everyone,

I am creating a form where users submit information to go into a database. I

Get Total From While Loop
I'm trying to get the total for each product and add them for a Grand Total to list outside the loop

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