473,508 Members | 2,119 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

showing results of query with right join

2 New Member
Hallo,
I am beginner,
I want to show on page results of this query: $query="SELECT mr_prehlad.mr_id, mr_kontakt.nazov_mr FROM mr_prehlad RIGHT JOIN mr_kontakt ON mr_kontakt.id_mr=mr_prehlad.mr_id WHERE mr_prehlad.'$co'='1' ORDER BY mr_prehlad.mr_id ";

But this while ( $row = MySQL_Fetch_Field( $result ) ) {
echo "<tr>\n";
foreach( $row as $hodnota ) {
echo "<td>\n";
echo $hodnota;
echo "</td>\n";
}
echo "</tr>\n";
}

is not function.

How to show with php in html pages query with left or right join?

Thanks for answer.
Feb 19 '07 #1
4 1571
tolkienarda
316 Contributor
Hallo,
I am beginner,
I want to show on page results of this query: $query="SELECT mr_prehlad.mr_id, mr_kontakt.nazov_mr FROM mr_prehlad RIGHT JOIN mr_kontakt ON mr_kontakt.id_mr=mr_prehlad.mr_id WHERE mr_prehlad.'$co'='1' ORDER BY mr_prehlad.mr_id ";

But this while ( $row = MySQL_Fetch_Field( $result ) ) {
echo "<tr>\n";
foreach( $row as $hodnota ) {
echo "<td>\n";
echo $hodnota;
echo "</td>\n";
}
echo "</tr>\n";
}

is not function.

How to show with php in html pages query with left or right join?

Thanks for answer.

ok first off you never define $result
second i am not sure if the \n shoud be inside your " i think they should be outside or just to be safe replace them with a <br /> tag.

eric
Feb 19 '07 #2
cihpet
2 New Member
ok first off you never define $result
second i am not sure if the \n shoud be inside your " i think they should be outside or just to be safe replace them with a <br /> tag.

eric
Of course I have implemented
$result=mysql_query($query);
but I get this answer from mySQL
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in
Warning: mysql_fetch_field(): supplied argument is not a valid MySQL result resource in

So it is nothing with <br /> tag.
Feb 20 '07 #3
tolkienarda
316 Contributor
if you could post your entire script it would help me follow it and if it wouldn't be a security problem a link to the page where this is active always helps

eric
Feb 20 '07 #4
ronverdonk
4,258 Recognized Expert Specialist
Take the single quotes out of the statement's WHERE clause
Expand|Select|Wrap|Line Numbers
  1. mr_prehlad.'$co'
Ronald :cool:
Feb 20 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
2795
by: david liu | last post by:
access 2000 query: here's what i want to do. from an asp page, perform a search on a table in access. i have used sql code in the asp page itself, but i'd rather execute a query in access. i...
6
4969
by: Alan | last post by:
I'm just about to start a project that needs to combine the results of a SQL Server query with the results of an Index Server query. The basic idea is that the user enters/selects a bunch of search...
14
1837
by: CJM | last post by:
I have a query which produces different results in the Access query builder and in an ASP page (via ADO) An example of the query is: ----------------------------------------------------------...
2
2028
by: mmitchell_houston | last post by:
I'm working on a .NET project and I need a single query to return a result set from three related tables in Access 2003, and I'm having trouble getting the results I want. The details: ...
7
2935
by: underground | last post by:
I have a problem that I've spent countless hours on and I'm more than certain this is a obviuos issue to an expert but I am still learning. I have a paging script that I have modified to display a...
2
3598
by: KTosser | last post by:
I have two tables, one contains contacts and the other has all the events and years that the contacts participated in. What I want is to be able to choose the years, say 2005 and 2006, and get all...
1
2749
by: babamc4 | last post by:
Hi All, I am trying to run a query to include null fields. My tables are as follows: Table Demographics 54 records (Main table) Table Follow Up During Radiotherapy 100+ records (Sub table)...
7
3900
by: alf8kitty | last post by:
Hello, Im still very new to php and am having a problem. I return a MySQL query to a form in my php page and I want to be able to export the form data to Excel when the users clicks a link (or a...
1
2265
by: dosingh | last post by:
i've put this page together using asp, html, javascript amd flash. java passes a number of variables over to the flash file but the flash graph does not appear. The error which appears is...
1
7046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7498
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5629
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5053
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3195
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1558
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
766
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.