last day (14 days later) » 

12:12 AM
I will check this chat in few minutes... let me know when you are in here
 
Hi there :)
 
Really appreciate your help
 
did you manage to solve your problem ?
 
Really do
 
12:13 AM
no problem
 
Not really
It echos blank
 
show your sql
did you understand my comment ? about removing the semicolon
 
`$sql = "SELECT utf.id, utf.Price, community1s.price, utf.Name, utf.Trend
FROM utf
INNER JOIN (select id, avg(price) price from community1 group by id) as community1s

ON utf.id=community1s.id
WHERE utf.Name LIKE 'm9%'
SELECT community1s.price AS com_price";`
 
Ok good
 
Also tried doing a string, didn't work
 
12:15 AM
the sql works I guess, but you cant echo ?
 
$comm = "select community1s.price as com_price";
 
no
that is wrong
 
Ok understood
Issue is
when I add the last select, it fails and shows 0 results
Without that, table gets there fine
 
what I mean is as you want to do echo... you must echo the column name...
 
I do do that
$row["community1s.price"] didn't work, neither did $row["com_price"]
 
12:16 AM
your column is community1s.price ... so you do $row["community1s.price"]
 
yep, tried that as well. Table now draws fine, but the column stays empty
Do you think it's a structural issue
with the DB?
 
do your query run with no failure ?
 
Yea, it queries fine for everything else.
Does mysql have an error log
like php?
 
your query is wrong
I see it now
you added SELECT community1s.price AS com_price";` after the where..
 
aha, where should I put it?
 
12:19 AM
this is wrong
`$sql = "SELECT utf.id, utf.Price, community1s.price as com_price, utf.Name, utf.Trend
FROM utf
INNER JOIN (select id, avg(price) price from community1 group by id) as community1s

ON utf.id=community1s.id
WHERE utf.Name LIKE 'm9%'
 
Alright let me try it
 
this means that your community1s.price will be named to com_price

and you will echo it as $row["com_price"]
 
Holy cow
It worked
wow
 
nice! G8
 
Awesome m8
Reallly
Appreciate your time :)
 
12:21 AM
your are welcome. no problem, upvote my answer and I will be happy ;)
I will go offline now, will come back later my friend. And good luck with coding, it is so fun!
 
Of course, it is fun with people like you !
Thank you and have a great day !
 
:) bye
 

last day (14 days later) »