NameSilo

Help

Namecheap AuctionsNamecheap Auctions
Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Watch

Marty Rogers

Account Closed
Impact
3
Hi,

Just wondering if anybody can help me, im doing a simple search feature on my new website and i have a column called type and i have entered MySpace Codes and MyCrib Codes in these for some of my row entries, i want visitors to be able to search just the myspace codes entries, i don't want any mycrib code entries to come up when searching.

I had this originally for my search:

SELECT * FROM codes WHERE name LIKE '%$name%'

Then tried changing it too:

$query = "SELECT * FROM codes WHERE type = 'MySpace Codes' AND name LIKE '%$name%'"

I also tried adding WHERE after AND but still no luck. Can anyone help me with this?

:)
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
We'd probably have to see your database table structure to tell you...
 
0
Close
Type and/or name could be reserved keywords. That might be your problem.
/me tries to find the reserved keywords page.

edit: http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html
So they aren't reserved.

Is it showing an error or saying anything that could give us a clue on what's wrong?
 
0
Close
Last edited:
0
Close
If you try:

$query = "SELECT * FROM `codes` WHERE `type`='MySpace Codes' AND `name` LIKE '%$name%'"

does it make any difference?
 
0
Close
I just changed it to that, but it's still doing the same thing - saying it can't find any results =S eek. It's getting annoying now :[ lol.
 
0
Close
Like I said earlier, we really need to see your DB table structure. Some copy and pasted error messages wouldn't hurt, either...
 
0
Close
Ok, I'll have another (unsure!) stab at:

$query = "SELECT * FROM `codes` WHERE `type`='MySpace%20Codes' AND `name` LIKE '%$name%'"

But as mentioned by TwistMyArm, seeing the DB table structure would help. Or simply change the type to an integer, e.g. 1 = MySpace Codes, 2 = MyCrib Codes and search for WHERE `type`='1' etc

Hope this helps,

Craig
 
0
Close
AIVikingsAIVikings

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back