The online racing simulator
#1 - SamH
MySQL.. gimme a clue, please.. # character
Hey folks.. I'm stumped. I'm trying to query a table and one of the records, the value of the field I'm looking up begins with a "#". So I escape the "#" with "\#" and search, and it's still not finding the record. Am I missing a trick?
SELECT `#column1`, `column2` FROM `table` etc. etc.

Should do it - those are intentionally backticks.

Incidentally, that's a bad choice for a character in a column
Err, that's not what he meant.
I think he wants to do something like

SELECT `column` FROM `table` WHERE `column` LIKE `#%`

But even though there are records in the column that begin with #, it still doesn't return anything. I dunno why it doesn't work, either.
Quote from AndroidXP :Err, that's not what he meant.

:doh: Thats what I get for doing too many things at once

Quote from AndroidXP :SELECT `column` FROM `table` WHERE `column` LIKE `#%`

Only use backticks for to refer to column names - subsitute that for ', and you are correct though.

i.e. for the stats wotsit:
mysql> select name from host where name like '#%';
+-------------------------------+
| name |
+-------------------------------+
| # ^3www.HPR-Network.com ^7#1 |
| # ^3www.HPR-Network.com ^7#2 |
| ##Bordeaux_FRA_Bismuths## |
| #Hughesie |
| #^4bia-clan ^8LFS-Racing |
| #^4bia-clan ^8LFS-Racing ^4II |
+-------------------------------+
6 rows in set (0.00 sec)

#5 - t1ger
Hi Sam!

If you are referring to the column name, then TAA's answer will help. However, I read it that you mean there is data in the table which starts with a "#". If this is the case, then I have just done it through MySQL Query Browser like this (searching for all rows where column1 begins with a "#".


SELECT * FROM table1 WHERE column1 like '#%'

Also, it worked like this in PHP for me with no escaping needed. (I say this because lots of things in PHP and html needs escaping so I assume you mean this!)



Tim

EDIT: /me must learn to type faster!
Quote from t1ger :Also, it worked like this in PHP for me with no escaping needed. (I say this because lots of things in PHP and html needs escaping so I assume you mean this!)

On a different note, prepared statements ftw
#7 - t1ger
/googles "prepared statements", learns something new!



Tim
#8 - SamH
Hey guys.. sorry.. got stuck on the phone..

Gah.. I don't understand it.. the data's in the table. When I run the code (edited for security )
"SELECT * FROM db.teams_details WHERE teams_name = '" & NoSQLInject(Request.QueryString("Team")) & "'"

it works as it should.. until I get to the team called "#low-racing" (without the quotes). In query browser, it returns a result.. in the page, no result. It's got me baffled. I assumed that the # was some kind of control character (relates to dates in some SQLs).. but I don't get this one at all.

http://www.raceauthority.com/fromTeam.asp?Team=#low-racing
Hahahah.

That's because the # in the URL is referring to a page-anchor. You'll have to URL encode the team name before writing it to the link.
#10 - SamH
Argh! Nooooo.. DOH!!!

LMAO! It's SOOOOO obvious, now you point it out! hehehehe
#11 - SamH
hehe.. all fixed! Thanks!!
Hehehe, it's the easiest things sometimes
#13 - SamH
hehe you ain't kidding! LOL!

Oh.. and prepared statements.. I like 'em, but you need to know way too much about the database field you're talking to, to make using them a speedy option. Granted, security is better.. but.. ugh..

[edit] dbQ_cmd.Parameters.Append dbQ_cmd.CreateParameter("param1", 200, 1, 24, dbQparam)

Or am I missing something.. and you can use this week's lottery numbers?
Quote from SamH :[edit] dbQ_cmd.Parameters.Append dbQ_cmd.CreateParameter("param1", 200, 1, 24, dbQparam)

Or am I missing something.. and you can use this week's lottery numbers?

That's bonkers.. ASP is le mank if it makes you use that syntax
Connect Text
how did i make a Connect text thats when i connect thats its come:


[red]Insim:[white][STC]Heiko connectet sucsesfull.


how did i can make this?

plz help me, or send me this "code"


Greetings Heiko
1. wrong thread
2. Your using lapper(iirc)
#17 - SamH
Quote from the_angry_angel :That's bonkers.. ASP is le mank if it makes you use that syntax

Yep, that's the syntax in ASP. I haven't tried bending it to see how far it goes without breaking yet.. mebbe I don't need all the bits.
I dont use Lapper.........
dont lie Nova
Well what are you using then we might be able to help you, also what language
i use MySql......
To the germans and german writers amongst us:
I think there are language problems here as there have been a few disjointed posts from Heiko1. Is there anyone who even vaguely understands InSim, and can produce some fluent german to help out? Using an online translator might only make things more confusing here.

To Heiko1:
Quote from Heiko1 :i use MySql......

MySQL is a database engine - it can't do anything with InSim, or even LFS, by itself - you just use it to store data and perform transforms on it
Quote from the_angry_angel :Is there anyone who even vaguely understands InSim, and can produce some fluent german to help out?

*raises hand*
i will try to make a Insim.....

can i have u Icq-Nummer?
meine is 355-863-550
You cannot "make a InSim" with MySQL. You need an actual programming language for that. Database queries alone don't make a program
1

MySQL.. gimme a clue, please.. # character
(26 posts, started )
FGED GREDG RDFGDR GSFDG