close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Select from multiple tables for search filter from single text field

Thread began 1/18/2016 10:16 am by stephen287384 | Last modified 1/19/2016 12:39 am by stephen287384 | 725 views | 11 replies

stephen287384

I must have an old version as there is no Debug line of code.

So should I drop the AS part of the query and just add bindings for each column?


OK think I got it sorted:

SELECT UserArtistName, UserBandName, UserInfluences, AlbumTitle, AlbumTrack1, AlbumTrack2, AlbumTrack3, AlbumTrack4, AlbumTrack5, AlbumTrack6, AlbumTrack7, AlbumTrack8, AlbumTrack9, AlbumTrack10, AlbumTrack11, AlbumTrack12, AlbumTrack13, AlbumTrack14, AlbumTrack15, AlbumTrack16, AlbumTrack17, AlbumTrack18, AlbumTrack19, AlbumTrack20, UserGenreID, UserState, UserBusinessName FROM users INNER JOIN discography ON AlbumUserID = UserID WHERE UserArtistName LIKE ? OR UserBandName LIKE ? OR UserInfluences LIKE ? OR AlbumTitle LIKE ? OR AlbumTrack1 LIKE ? OR AlbumTrack2 LIKE ? OR AlbumTrack3 LIKE ? OR AlbumTrack4 LIKE ? OR AlbumTrack5 LIKE ? OR AlbumTrack6 LIKE ? OR AlbumTrack7 LIKE ? OR AlbumTrack8 LIKE ? OR AlbumTrack9 LIKE ? OR AlbumTrack10 LIKE ? OR AlbumTrack11 LIKE ? OR AlbumTrack12 LIKE ? OR AlbumTrack13 LIKE ? OR AlbumTrack14 LIKE ? OR AlbumTrack15 LIKE ? OR AlbumTrack16 LIKE ? OR AlbumTrack17 LIKE ? OR AlbumTrack18 LIKE ? OR AlbumTrack19 LIKE ? OR AlbumTrack20 LIKE ? OR UserGenreID = ? OR UserState = ? OR UserBusinessName LIKE ?");
$rsResults->bindParam("c", "".(isset($_POST['keyword'])?$_POST['keyword']:"") ."", "-1"); //paramUserArtistName
$rsResults->bindParam("c", "".(isset($_POST['keyword'])?$_POST['keyword']:"") ."", "-1"); //paramUserBandName
$rsResults->bindParam("c", "".(isset($_POST['keyword'])?$_POST['keyword']:"") ."", "-1"); //paramUserInfluences
$rsResults->bindParam("c", "".(isset($_POST['keyword'])?$_POST['keyword']:"") ."", "-1"); //paramAlbumTitle
$rsResults->bindParam("c", "".(isset($_POST['keyword'])?$_POST['keyword']:"") ."", "-1"); //paramAlbumTrack1
$rsResults->bindParam("c", "".(isset($_POST['keyword'])?$_POST['keyword']:"") ."", "-1"); //paramAlbumTrack2
$rsResults->bindParam("c", "".(isset($_POST['keyword'])?$_POST['keyword']:"") ."", "-1"); //paramAlbumTrack3
$rsResults->bindParam("c", "".(isset($_POST['keyword'])?$_POST['keyword']:"") ."", "-1"); //paramAlbumTrack4
$rsResults->bindParam("c", "".(isset($_POST['keyword'])?$_POST['keyword']:"") ."", "-1"); //paramAlbumTrack5
$rsResults->bindParam("c", "".(isset($_POST['keyword'])?$_POST['keyword']:"") ."", "-1"); //paramAlbumTrack6
$rsResults->bindParam("c", "".(isset($_POST['keyword'])?$_POST['keyword']:"") ."", "-1"); //paramAlbumTrack7
$rsResults->bindParam("c", "".(isset($_POST['keyword'])?$_POST['keyword']:"") ."", "-1"); //paramAlbumTrack8
$rsResults->bindParam("c", "".(isset($_POST['keyword'])?$_POST['keyword']:"") ."", "-1"); //paramAlbumTrack9
$rsResults->bindParam("c", "".(isset($_POST['keyword'])?$_POST['keyword']:"") ."", "-1"); //paramAlbumTrack10
$rsResults->bindParam("c", "".(isset($_POST['keyword'])?$_POST['keyword']:"") ."", "-1"); //paramAlbumTrack11
$rsResults->bindParam("c", "".(isset($_POST['keyword'])?$_POST['keyword']:"") ."", "-1"); //paramAlbumTrack12
$rsResults->bindParam("c", "".(isset($_POST['keyword'])?$_POST['keyword']:"") ."", "-1"); //paramAlbumTrack13
$rsResults->bindParam("c", "".(isset($_POST['keyword'])?$_POST['keyword']:"") ."", "-1"); //paramAlbumTrack14
$rsResults->bindParam("c", "".(isset($_POST['keyword'])?$_POST['keyword']:"") ."", "-1"); //paramAlbumTrack15
$rsResults->bindParam("c", "".(isset($_POST['keyword'])?$_POST['keyword']:"") ."", "-1"); //paramAlbumTrack16
$rsResults->bindParam("c", "".(isset($_POST['keyword'])?$_POST['keyword']:"") ."", "-1"); //paramAlbumTrack17
$rsResults->bindParam("c", "".(isset($_POST['keyword'])?$_POST['keyword']:"") ."", "-1"); //paramAlbumTrack18
$rsResults->bindParam("c", "".(isset($_POST['keyword'])?$_POST['keyword']:"") ."", "-1"); //paramAlbumTrack19
$rsResults->bindParam("c", "".(isset($_POST['keyword'])?$_POST['keyword']:"") ."", "-1"); //paramAlbumTrack20
$rsResults->bindParam("i", "".(isset($_POST['genre'])?$_POST['genre']:"") ."", "-1"); //paramGenre
$rsResults->bindParam("s", "".(isset($_POST['state'])?$_POST['state']:"") ."", "-1"); //paramState
$rsResults->bindParam("cl", "".(isset($_POST['business'])?$_POST['business']:"") ."", "-1"); //paramUserBusinessName



Thanks for your help Ray.


One of the columns has data as comma separated, so I tried:

OR (UserInfluences IN (?))

$rsResults->bindParam("cl", "".(isset($_POST['keyword'])?implode(",",$_POST['keyword']):"") ."", "-1"); //paramUserInfluences

but not getting any results?? Any idea why?

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...