Topic: PG SQL Trouble

I've got this query

$SQL = "SELECT DISTINCT reward_item, reward_ql, mission_ql FROM mission_reward WHERE reward_item LIKE \"%basic%\" ORDER BY reward_item, reward_ql";

And i have in db:

A Basic Left-Arm Implant - Refined | 204 | 204
A Basic Left-Wrist Implant - Refined | 200 | 200

I can't figure out why it won't work or what i have done wrong...

Any ideas?

Re: PG SQL Trouble

You can start by telling us what's wrong :) You told us how the query looks and what the database contains, but not what the result is or even what result you are after.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: PG SQL Trouble

you're using like ... and like is case sensitive ...

The key word ILIKE can be used instead of LIKE to make the match case insensitive according to the active locale. This is not in the SQL standard but is a PostgreSQL extension.

(in the columns it's Basic ... and your search looks for basic)

Re: PG SQL Trouble

Ah, maybe that was the problem. I've struggled with that myself (in userlist.php I believe). I hate it when they stray from the standard like that. Sure, you can implement features outside the standard, but changing the way common operators such as LIKE works, is just low.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: PG SQL Trouble

yep ... therefore I always go into the documentations for the thing I'm using as soon as I hit some obstacle, php.net and mysql.org get quite frequent visits from me roll big_smile

Re: PG SQL Trouble

I never read documentation. Documentation is for girls!

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: PG SQL Trouble

Well, i thought i read the manual pretty much on teh like keyword, and i can't say i found ILIKE popping out anywhere.

With ILIKE it works ok now...

on this page: http://ao.nonet.org/tools/missions/
Now i want to try and have only one item grouped together, and a list of Item QL beside it.
Mission QL is not important.

I'd like it something like this:

ItemX 100
      101
      105
ItemY 100
      105
      109

Anyone know what i mean?
I don't know how to get the numbers in row if i just want one item then the list of ql's for it.

Re: PG SQL Trouble

The page never shows up for me. It just loads and loads and loads ....

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: PG SQL Trouble

It working! but what it is all about...

Everywhere i can see sleeves...It doesn't  have intro page also. tongue

God wisely designed the human body so that we can neither pat our own backs nor kick ourselves too easily

10 (edited by newera70 2004-09-11 21:53)

Re: PG SQL Trouble

ameenullah wrote:

It working! but what it is all about...

Everywhere i can see sleeves...It doesn't  have intro page also. tongue

Looks to me like its gonna be some kind of RPG game but not a visual one like a generated fight kind i could be very off though....

EDIT: NVM i looked at it better (i used the search thing)

Re: PG SQL Trouble

There have been some bugs with the loops on the page.
Been away for a few days but it should behaive properly now.

What's in the database is mission reward items that can be rollable for the mmorpg anarchy online.
A friend made some mods to a program that produces logs with mission reward items.
I parse those logs into my db and i can search it for something and check if it's rollable and what settings and QL the mission needs to be.
Atm i'm quite happy with the list i'm producing.
Going to add some refinements later but the basic workings is in there.