The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
ok basically im writing a searching script but when i dont type in an image name, an artist name,but i type in a gallery id it says there are none cause its selecting with image name and artist name being nothing. is there a away around this so it will just select everything with that gallery id even though image name and artist name are set to nothing?
|
#2
|
||||
|
||||
![]()
Or
![]() |
#3
|
||||
|
||||
![]()
but i still want to if like artist name has some value that it will also refine the results from gallery id and remove those results which arent equal to artist name
|
#4
|
||||
|
||||
![]()
OK, so let's figure out what you want
![]() If I am right we're talking about 3 fields: Image Name, Artist Name and Gallery ID. Pleasse tell me what you want to have returned in each of the following cases:
|
#5
|
||||
|
||||
![]()
in all those cases i want all the data in my gallery table to be returned which matches the criteria in WHERE
|
#6
|
||||
|
||||
![]()
Yeah
![]() And what IS the criteria? |
#7
|
|||
|
|||
![]()
Can you post the query or the code for us to see? Would help solve the problem.
|
#8
|
||||
|
||||
![]() PHP Code:
|
#9
|
||||
|
||||
![]()
This will return all rows from table gallery wher gallery_id is $gallery, artist_name ist $artitstname and image_name is $imgname.
But it seems like this is not what you want. I've asked before how you want your conditions, but you did not gave me a useful answer so I can only guess: [sql] SELECT * FROM gallery WHERE (gallery_id = '$gallery' AND '$artistname'='' AND '$imgname'='') OR (gallery_id='$gallery' AND artist_name='$artistname' AND image_name='$imgname') [/sql] This will return all rows table gallery wher gallery ID is $gallery, artist_name ist $artitstname and image_name is $imgname, or all rows from table gallery where gallery ID is $gallery and $artistname, $imgname are empty. A better way would be to construct your query in PHP so it does only contain conditions for columns you really care for. |
#10
|
||||
|
||||
![]()
ok i see how it will work
![]() did you see mess up on the first one? '$imgname'='' ? |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|