MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 5th, 2012, 03:15 AM
rootKID rootKID is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 3 rootKID User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 38 sec
Reputation Power: 0
Smile Unknown column 'priser.pr_id' in 'on clause'


Reply With Quote
  #2  
Old October 5th, 2012, 03:42 AM
sr sr is offline
Problem Solver
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: Jan 2001
Location: Stockholm, Sweden
Posts: 4,436 sr User rank is Colonel (50000 - 60000 Reputation Level)sr User rank is Colonel (50000 - 60000 Reputation Level)sr User rank is Colonel (50000 - 60000 Reputation Level)sr User rank is Colonel (50000 - 60000 Reputation Level)sr User rank is Colonel (50000 - 60000 Reputation Level)sr User rank is Colonel (50000 - 60000 Reputation Level)sr User rank is Colonel (50000 - 60000 Reputation Level)sr User rank is Colonel (50000 - 60000 Reputation Level)sr User rank is Colonel (50000 - 60000 Reputation Level)sr User rank is Colonel (50000 - 60000 Reputation Level)sr User rank is Colonel (50000 - 60000 Reputation Level)sr User rank is Colonel (50000 - 60000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 8 h 25 m 47 sec
Reputation Power: 532
There is no "priser" table present in your query hence the error message -"Unknown column 'priser.pr_id' ".

My guess is that you don't want to perform a self join so the table in the second join should be "priser" like this instead:
Code:
SELECT
p1.p_id,
p1.p_titel,
p1.p_kunstner,
p1.p_oprettet,
image_url.img_url,
genre.g_navn,
priser.pr_pris
FROM
produkter AS p1
INNER
  JOIN
    priser
    ON p1.p_FK_pris = priser.pr_id
INNER
  JOIN
    image_url
    ON image_url.img_FK_products = p1.p_id
INNER
  JOIN
    genre
    ON p1.p_FK_genre = genre.g_id
__________________
/Stefan

Reply With Quote
  #3  
Old October 5th, 2012, 03:58 AM
rootKID rootKID is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 3 rootKID User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 38 sec
Reputation Power: 0
hmm....
yeah, working now... lol..

should have seemed that one comming...
anyways... working now, almost...

now they WONT getting out...
freaking annoying...

CODE:

PHP Code:
<?php
$bg 
'';// variablen $bg oprettes og er tom.
/*p1 = Aliases instead of (produkter)...*/
$query_produkter "
SELECT
    p1.p_id,
    p1.p_titel,
    p1.p_kunstner,
    p1.p_oprettet,
    image_url.img_url,
    genre.g_navn,
    priser.pr_pris
FROM
    produkter AS p1
        INNER JOIN priser ON p1.p_FK_pris = priser.pr_id
        INNER JOIN image_url ON image_url.img_FK_products = p1.p_id
        INNER JOIN genre ON p1.p_FK_genre = genre.g_id"
;
$result_produkter mysql_query($query_produkter)or die(mysql_error());
?>
<table class="butikliste_tableshow">
<tr>
<td>&nbsp;</td>
<td>KUNSTNER</td>
<td>TITEL</td>
<td>GENRE</td>
<td>OPRETTET</td>
<td>PRIS</td>
<td>KØB</td>
</tr>
<?php
while($produkter_row mysql_fetch_array($result_produkter))
{
    
$bg = ($bg == '' '#999999' '');//skal antages som en if/else saetning...
    
echo "<tr bgcolor='$bg'>";
    
    echo 
"<td>"."<img src='50x50/".$produkter_row['img_url']."' />"."</td>";
    echo 
"<td>"."<a href='butik_detalje.php?pid=".$produkter_row['p_id']."'>".$produkter_row['p_kunstner']."</a>"."</td>";
    echo 
"<td>".$produkter_row['p_titel']."</td>";
    echo 
"<td>".$produkter_row['g_navn']."</td>";
    echo 
"<td>".$produkter_row['addeddate']."</td>";
    echo 
"<td>".$produkter_row['pr_pris']."</td>";
    echo 
"<td>"."<a href='#'><img src='styles/images/kurv.png' /></a>"."</td>";
    
    echo 
"</tr>";
}
//While Statement ends...
?>
</table>


Ideas?...

Reply With Quote
  #4  
Old October 5th, 2012, 04:07 AM
cafelatte cafelatte is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Mar 2008
Posts: 1,923 cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 5 Days 16 h 21 m 8 sec
Reputation Power: 377
"now they WONT getting out..."

I'm not sure what this means, so not sure how to respond.

For problems with MySQL queries, it's often helpful if we're able to replicate your scenario, so consider providing CREATE and INSERTs for each of the relevant tables, together with the result set you'd expect from your query.

Reply With Quote
  #5  
Old October 5th, 2012, 04:48 AM
rootKID rootKID is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 3 rootKID User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 38 sec
Reputation Power: 0
ok lol... i should take a knife and put my heart out of my boddy...

i had no SQL rows inside produkter table... lol...
working 100% now -.-'...

sorry for waste of time :P...

Reply With Quote
  #6  
Old October 5th, 2012, 05:10 AM
cafelatte cafelatte is offline
Contributing User
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Mar 2008
Posts: 1,923 cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level)cafelatte User rank is Major (30000 - 40000 Reputation Level) 
Time spent in forums: 1 Month 5 Days 16 h 21 m 8 sec
Reputation Power: 377
On this occasion, that might be a step too far.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > Unknown column 'priser.pr_id' in 'on clause'

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap