Dear All,,


I need ur help regarding the below matter....

I had a form having 40 fields comming from 4 tables...
I want to let the user to search a record using any of these 40 fields...
For that i joined these tables using the "join" statement...

Now the problem starts...
I can' t retreve the fields that satisfying the join query..

&query_join="...query....";
$result_join=mysql_query($query_join);
and after that when i try to save the result to $row using
while($row_join=mysql_fetch_array($result_join))
{
$J_name=$row_join; }//

after that when i try to display the $J_name variable it is not displaying any value....

when i echoed the query it is displaying correctry and there is no error...
and also the echo $result_join; gives resourse id #4;;;;;

I can't find any reason y the variable $j_name is not printing any value...

Please help me....

Recommended Answers

All 3 Replies

Did you execute your query in phpmyadmin/mysql ? Is it just not printing any values or is it giving any error ? Can you show us your query ?

Your SQL-query has been executed successfully (Query took 0.0012 sec)
SQL-query:
SELECT *
FROM reg_personal AS t1
INNER JOIN reg_services AS t2
INNER JOIN reg_english_level AS t3
INNER JOIN refered_by AS t4 ON ( t1.personal_code = t2.services_code
AND t2.services_code = t3.english_code
AND t3.english_code = t4.reference_code )
AND (
t1.personal_name LIKE 'Anoop Menon'
OR t1.personal_sex LIKE 'Female'
OR t1.personal_matrital_status LIKE ''
OR t1.personal_mobile LIKE ''
OR t1.personal_phone LIKE ''
OR t1.personal_email LIKE ''
)
AND (
t2.services_service1 LIKE '0'
OR t2.services_country1 LIKE '0'
OR t2.services_location1 LIKE '0'
OR t2.services_level1 LIKE '0'
OR t2.services_universities1 LIKE '0'
OR t2.services_course1 LIKE '0'
)
AND (
t2.services_service2 LIKE '0'
OR t2.services_country2 LIKE '0'
OR t2.services_location2 LIKE '0'
OR t2.services_level2 LIKE '0'
OR t2.services_universities2 LIKE '0'
OR t2.services_course1 LIKE '0'
)
AND (
t3.english_level1 LIKE '0'
OR t3.english_total_score1 LIKE ''
OR t3.english_writing_score1 LIKE ''
OR t3.english_speaking_score1 LIKE ''
OR t3.english_listening_score1 LIKE ''
OR t3.english_reading_score1 LIKE ''
OR t3.english_result1 LIKE '0'
)
AND (
t3.english_level2 LIKE '0'
OR t3.english_total_score2 LIKE ''
OR t3.english_writing_score2 LIKE ''
OR t3.english_speaking_score2 LIKE ''
OR t3.english_listening_score2 LIKE ''
OR t3.english_reading_score1 LIKE ''
OR t3.english_result2 LIKE '0'
)
AND (
t4.refered_by LIKE '0'
)
LIMIT 0 , 30

query is successful but it is not printing any value....

This is the query Pls help me///

Your query isn't returning any rows. Check your conditions, try one condition at a time, check where you are going wrong.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.