View Full Version : mysql views and many queries(select) do the same job ?
leonidassavvides
10-24-2008, 08:02 AM
mysql views and many queries(select) do the same job ?
May reference fields from 2 or more mysql queries(select) same time using two
$row = mysql_fetch_row($result);
$row1 = mysql_fetch_row($result1);
$x = $row[1];
$x1 = $row1[1];
??????
james438
10-27-2008, 06:48 AM
Your code makes sense, but I don't think many people know exactly what you are asking. Could you elaborate more?
leonidassavvides
10-27-2008, 08:04 AM
I mean rather than using "mysql views" I can use two SELECT queries ? It;s the same ?
james438
10-27-2008, 08:45 AM
Sorry, but that is actually less clear and more vague than your first post. The more I go over your post the more sure I am that I don't know what you are asking. Do you want to search multiple tables, columns at the same time? do you want to concatenate? Do you want to combine the results of two queries? We need a lot more information. Examples would also help. It does not have to be code, but code helps too.
leonidassavvides
10-27-2008, 05:24 PM
I mean rather than using "mysql views" to join two SELECT queries(two tables) using common fields PK=FK ,
CREATE VIEW Name_View (alias names _ same in number as fields of view_comma separated) AS
SELECT TABLENAME1.FIELD1, TABLENAME1.FIELD3, TABLENAME1.FIELD5, TABLENAME2.FIELD1, TABLENAME2.FIELD6, TABLENAME2.FIELD7
FROM TABLENAME1, TABLENAME2
WHERE TABLENAME1.FIELD1 = TABLENAME2.FIELD1;
I can use two SELECT queries SEPARATE and mixed refer to the fields of the two queries ? It's the same ?
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.