SELECT *
FROM gig
LEFT JOIN genre ON gig.genreId = genre.genreId
LEFT JOIN venue ON gig.venueID = venue.vid
WHERE gig.gigid = $gigdetail
I'd replace the dash with [table].[columnames]. Also, you're using four
different naming conventions in your columns - gigid, genreId, venueID
and vid. If I
($result))
{/
/$sub= $row[venue].[vname];/
/}/
Regards
- Original Message
From: Evert Lammerts [EMAIL PROTECTED]
To: Nasreen Laghari [EMAIL PROTECTED]
Cc: php-db@lists.php.net
Sent: Wednesday, April 23, 2008 11:48:39 AM
Subject: Re: [PHP-DB] Select query with Forein key Relation
ministry_directory_listing_categories.ministry_directory_category_reference =
10 AND
ministry_directory_listing_categories.ministry_directory_category_reference
= 11
Can a record really have a reference for two different id's like this?
ie can it be both '10' and '11' at the same time?
Two different rows Chris.
reference ministry_directory_entry ministry_directory_category_reference
13 1 10
14 1 11
What I am trying to do is allow the user to make a more specific search.
Ron
On Mon, 2008-03-10 at 10:37 +1100, Chris wrote:
Ron Piggott wrote:
Two different rows Chris.
That's the problem then.
Your query is saying get records with category_reference of 10 and it
has to have category_reference of 11 as well.
No such rows exist.
Maybe that should be an 'or' or 'in' (same thing).
...
I think what you mean to do is use IN(). And I would suggest table aliases.
So it could look like this:
SELECT * FROM ministry_directory md INNER JOIN
ministry_directory_listing_categories mdlc ON md.entry =
mdlc.ministry_directory_entry
WHERE md.listing_type = 2
AND
Thanks
On Mon, 2008-03-10 at 12:56 +1300, Bruce Cowin wrote:
I think what you mean to do is use IN(). And I would suggest table aliases.
So it could look like this:
SELECT * FROM ministry_directory md INNER JOIN
ministry_directory_listing_categories mdlc ON md.entry =
$query = mysql_query(SELECT * from gig WHERE gigName='$gig_name' OR WHERE
gig_fdate='$sdate');
This one.
I'd suggest you get a book to help you with the basics, something like
this should do (first hit in amazon, haven't actually read this
particular book):
In MySQL, both OR and || are valid logical or operators. You can only
have one Where clause, thus your last example is correct.
--GREG
On Wed, Feb 27, 2008 at 6:44 PM, Nasreen Laghari [EMAIL PROTECTED]
wrote:
Hi All,
Thank you for increasing my knowledge about PHP/MYSQL.
I am creating a
Greg Bowser wrote:
In MySQL, both OR and || are valid logical or operators. You can only
have one Where clause, thus your last example is correct.
Though in postgresql and db2 (and some other dbs) || means
concatenate so stick with using the word OR in this situation
otherwise you'll run
On Wed, Feb 27, 2008 at 6:44 PM, Nasreen Laghari
[EMAIL PROTECTED] wrote:
I am creating a SEARCH, by only using one table. The search form is same as
Inserting item (search has form of all fields in table ), difference is
SEARCH page doesnt have validation . Therefore user can enter
On 27 Feb 2008, at 23:44, Nasreen Laghari wrote:
Thank you for increasing my knowledge about PHP/MYSQL.
The question you ask below is basic SQL syntax. Please read the MySQL
manual before asking here - answers at this level are all in there.
http://mysql.com/doc
Oh, and once you have it
$query = mysql_query(SELECT * from gig WHERE gigName='$gig_name' or
gig_fdate='$sdate');
You can not use more then one WHERE in your sql statement... And SQL accepts
OR and AND..
--
Stephen Johnson c | eh
The Lone Coder
http://www.thelonecoder.com
continuing the struggle against bad code
$query = mysql_query(SELECT * FROM gig WHERE gigName='$gig_name' OR
gig_fdate='$sdate');
You only use the WHERE clause once then use parenthesis, AND and OR to create
the logical conditions.
If you have access to the mysql server, maybe through phpMyAdmin or
something, I'd highly recommend
I'm trying to pull all the records from the table class where classID is
not equal to the value of classID in the table assignment.
Currently, I have 'select class.classID, class.classDesc from class,
assignment where assignment.classID = class.classID and
assignment.assignmentID=$assidn'.
Thanks!
It works
Cole
On Thu, 2004-08-26 at 16:45, [EMAIL PROTECTED] wrote:
I'm trying to pull all the records from the table class where classID is
not equal to the value of classID in the table assignment.
Currently, I have 'select class.classID, class.classDesc from class,
Irin said:
$sql = mysql_query(SELECT * FROM class where timetable_day='Monday');
$row = mysql_fetch_array($sql);
$result = $db-query($sql);
$numofrows = mysql_num_rows($sql);
From the PHP manual:
array mysql_fetch_array ( resource result [, int result_type])
You can't send the function
Irin said:
$sql = mysql_query(SELECT * FROM class where timetable_day='Monday');
Oops, I see that he DID do a mysql_query and save the result resource in
$sql. Sorry, guys! I haven't had my coffee yet this morning!
Katie Dewees
Web Developer
E-mail: [EMAIL PROTECTED]
--
PHP Database Mailing
table includes identical fgnumber-faqid
rows.
:)
Hynek
-Original Message-
From: Ignatius Reilly [mailto:[EMAIL PROTECTED]]
Sent: 10. prosince 2002 23:42
To: [EMAIL PROTECTED]; Michael Knauf/Niles
Subject: Re: [PHP-DB] Select Query Help...
Try:
SELECT DISTINCT F.question, F.answer
Try:
SELECT DISTINCT F.question, F.answer
FROM Faqs AS F, FaqsRelatedToProducts Table AS FP
WHERE F.faqid = FP.faqid
DTH?
Ignatius
- Original Message -
From: Michael Knauf/Niles [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, December
Have you thought about normalizing your data model? It could make your
task a lot easier.
Doug
At 11:33 PM 4/13/01 +0530, Sharmad Naik wrote:
I have three table called table1, table2, table3 all having fields like:
table1 contain id and username and id referencing table4
table2 contains id and
On Fri, Apr 13, 2001 at 02:23:50PM -0400, Doug Semig wrote:
Have you thought about normalizing your data model? It could make your
task a lot easier.
I have normalized my table structure this is just a practice model i m trying
I want that the search should be on username whereby first i
22 matches
Mail list logo