building SQL Query From another Query in php

Posted by Nina on Stack Overflow See other posts from Stack Overflow or by Nina
Published on 2010-05-15T16:02:12Z Indexed on 2010/05/15 16:04 UTC
Read the original article Hit count: 437

Filed under:
|
|
|

Hello

when I Try to built Query from another Query in php code I Faced some problem
can you tell me why? :(

code :

$First="SELECT ro.RoomID,ro.RoomName,ro.RoomLogo,jr.RoomID,jr.MemberID,ro.RoomDescription FROM joinroom jr,rooms ro where (ro.RoomID=jr.RoomID)AND jr.MemberID = '1' ";

$sql1 = mysql_query($First);

$constract .= "ro.RoomName LIKE '%$search_each%'";

$constract="SELECT * FROM $sql1 WHERE $constract ";// This statment is Make error

© Stack Overflow or respective owner

Related posts about sql

Related posts about php