building SQL Query From another Query in php -


When I try to create a query from another query in php code, then I have had some problems - do you Can you tell me why? : (

Code:

  $ first = "select ro.RoomID, ro.RoomName, ro.RoomLogo, Jr.RUID, Jr. Member ID, ro.RoomDescriptionFROM ( RORIID = JR.RoomID) and Junior.memberID = '1' "; $ sql1 = mysql_query ($ first); $ section. =" '% $ Search_each%' like 'Ro.RoomName'; $ Constract = "SELECT * FROM $ sql1 WHERE $ constract "; // This statement is to be paid  

Thank you, now it's work! ..

But I faced another problem, When I display the results of this query ..

Code:

  $ run = mysql_query ($ Sql); while ($ runrows = mysql_fetch_assoc ($ run)) $$ rouman = $ runner [[ro.RoomName] BR & gt; $ RoomDescription 

;}

The last part of the Regardin error, the assignment you are facing The prefix "ro" has to be removed from the right hand part of the statements.

So your real code should have been: -

  $ run = mysql_query ($ sql); While ($ runraz = mysql_fetch_assoc ($ run)) {$ RoomName = $ runner [[RoomName "]; $ roomdiction = $ runner [[roomdescription]]; echo" $ Riemannam $ room description ";}  

Try it above, and you should work fine; unless there is some error about hosting your database or in the presence of your area in your database connection. / P>


Comments