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

Problem with PHP code- simple contact form
I'm relativily new to PHP; I know HTML and CSS stuff but I have a problem- I have a contact form wit

IIS on 2003 anon access disabled issue
I have an IIS server that belongs to a domain, and anonymous access is turned off for all my sites.

Problem with coding MySQL query
I'm having heaps of trouble getting one of my PHP/MySQL queries to work for some reason (and the fun

! = ''
In the following 'IF' statement if v_ompcat = PU for example then Oracle equates that 'IF' statement

Please help - should be a simple fix.. driving me nuts
Everything seemed to be working fine. I have a table, it alphabetically lists a bunch of cities and

Custom array sort? asc then desc
Any ideas how I could sort this array? I've been trying for a while. Maybe with usort, but I have no

Pls help with PHP
Pls can anyone direct me on how to create a user account for a customer. For example i want know if

Points for Wiki contribution
Hi everyone,

I want to know how long does it take for the moderator to award points for a

XML Grouping
I'm using xml_parse_into_struct to get all my elements, but now I need to group them. For example, h

Preventing blank or already entered values
Im trying to learn how to place a read file line by line and prevent duplicate entries and also BLAN

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