Jump to content

dynamic query creation


cljones81

Recommended Posts

Hello:

 

I wonder if some could help me with this problem:

 

I've created this form to construct their own fairly advanced dynamic queries using field names, keywords, query expressions AND, OR. Everything is fine if the user constructs the largest query size available e.g. Select * from table where fieldname1 = keyword1 AND fieldname2 = keyword2 OR fieldname3 = keyword3 AND fieldname4 = keyword4.

 

The problem comes when you try and create a shorter query even with the unused fields set to their null values, the error, mysql_num_rows(): supplied argument is not a valid MySQL result resource appears.

 

My question is this is there any way that you could get it to ignore the empty fields and just construct and process a query based on the fields filled in using php?

 

Link to comment
https://forums.phpfreaks.com/topic/97391-dynamic-query-creation/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.