Help with simple query


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

Hi,

I'm trying to do a Query with a Union where I want to print the number of rows $tc contains. Can anyone see what's wrong with this:

Did you know?Explore Trending and Topic pages for more stories like this.
Code: $tc = @mysql_num_rows(mysql_query("(SELECT * FROM tbl1 WHERE id = $id) UNION (SELECT * FROM tbl2 WHERE id = $id)"));
print $tc;
No comments posted yet

Your Answer:

Login to answer
296 Like 9 Dislike
Previous forums Next forums
Other forums

DateTimeZone::listIdentifiers headache
http://php.net/manual/en/datetimezone.listidentifiers.php


So the documentation states tha

Multiple Dropdown Selections
I have a form that let's a user insert a page with the ability to select categories. I want them to

Need help/w Page: 1,2,3,4 function!
So I have this code im working on where it's ment to display seperate pages having 20 logs each
I

Strange cookie problem. setcookie dependant on where user was directed from?
Hello,

I have a website that sets a cookie when a user visits the website. The cookie holds a

I need some help with the IF command...
I have a large number of images in one section of my website with the .jpg format. I'm adding a bun

Using mysql_real_escape_string for displayed content
On my website users can input data into a textarea and it will store it in the mysql database. But,

upload control not working with update panel
Hi,

I am working with Asp.Net FileUpload control with ajax update panel,

if i use the

Problem with DB connection
Hello there! I'm new to this forum and I'm new to PHP coding also. I wrote something that doesn't ma

MVC - Code review
I'm in the process of trying to wrap my head around MVC, and as part of that, I'm attempting to impl

Code doesn't print what i wanted it too. Please help!
Hi there,

I wrote this code to mae it so that in the form before it that the user said their

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