Welcome
Welcome to <strong>txtSQL</strong>.

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, <a href="/profile.php?mode=register">join our community today</a>!

Insert string bug

Post bugs here

Insert string bug

Postby mcm on Fri Nov 16, 2007 12:54 am

i am using this column
'NickName' => array('type' => 'string', 'max' => 150)

now when the string needs to be updated or inserted contains a $w or other letters after the $, the core spits errors like "undefined variable $w on line..."
i managed a workaround so i replace the "$w" with a "($)w" then the insert and update works fine but that needs to convert every nickname before inserting and after selecting to output the real nickname agein.

function db_nick($str_in)
{
return str_replace('$','($)',$str_in);
}

function game_nick($str_in)
{
return str_replace('($)','$',$str_in);
}

is there a soulution yet ?
mcm
 
Posts: 4
Joined: Fri Nov 16, 2007 12:32 am
Location: germany

Postby FarazAli on Mon Dec 10, 2007 5:05 pm

Try backslashing the dollar sign inside of double quotes...

so for example:

Code: Select all
$blah   = "123456";
$string = "blah blah blah $blah" // equals "blah blah blah 12345"
$string = "blah blah blah \$blah" // equals "blah blah blah $blah"


or you can use single quotes and that will work too.

Code: Select all
$string = 'blah blah blah $blah'; // equals "blah blah blah $blah"
Latest txtSQL Stable Release: txtSQL 2.2 Final

Track 4.0 Development

Image
FarazAli
Site Admin
 
Posts: 73
Joined: Sun Mar 25, 2007 1:08 pm
Location: New Jersey, NJ

Postby mcm on Tue Dec 11, 2007 1:04 am

i can not edit the string, the nick name variable is
$nickname='$word';

now '$word' is the string and it needs the $ for further usage it should realy accept that '$w' is a string and not a variable like it accepts that '($)' is a string, the core splits the '$word' to $w

take an input field eg. for username and input a username $word$
mcm
 
Posts: 4
Joined: Fri Nov 16, 2007 12:32 am
Location: germany

Postby FarazAli on Tue Dec 11, 2007 11:12 pm

try using the str_replace method to backslash the dollar sign. This should prevent the PHP interpretor from interpolating a variable into the string.

Code: Select all
str_replace("$", "\\\$", $string);
Latest txtSQL Stable Release: txtSQL 2.2 Final

Track 4.0 Development

Image
FarazAli
Site Admin
 
Posts: 73
Joined: Sun Mar 25, 2007 1:08 pm
Location: New Jersey, NJ

Postby gerald on Thu Jan 31, 2008 9:55 pm

Sir I realy impress your txtsql...
I manage 1 website I try to use your txtsql...I did simulate it many times...but when I upload my simple application Im very happy bcause almost are working instead of "insert"...I found out that my webhosting uses the unix os and I simulated my work in Windows os...is there any comments or suggestion from you why the insert command in txtsql doesnt work in unix os?...the state as
"txtSQL Fatal Error: Error opening table account in... txtSQLAdmin/index.php on line 62 "
gerald
 
Posts: 1
Joined: Thu Jan 31, 2008 9:33 pm

Postby Dragon_Legion on Fri Aug 15, 2008 3:01 pm

gerald wrote:Sir I realy impress your txtsql...
I manage 1 website I try to use your txtsql...I did simulate it many times...but when I upload my simple application Im very happy bcause almost are working instead of "insert"...I found out that my webhosting uses the unix os and I simulated my work in Windows os...is there any comments or suggestion from you why the insert command in txtsql doesnt work in unix os?...the state as
"txtSQL Fatal Error: Error opening table account in... txtSQLAdmin/index.php on line 62 "


you need to change your permissions...the file should be at LEAST 755, if that doesnt work change it to 757
Dragon_Legion
 
Posts: 5
Joined: Thu Aug 14, 2008 6:40 pm

Re: Insert string bug

Postby zzw08 on Tue Jul 14, 2009 5:32 am

http://www.fashion-products.com [url=http://www.fashion-products.com ]is a sell air force one,
air jordan,bape,kicks,nike,Jerseys,Shoes,Clothing,Bag,Glasses,Caps&Hats,sneakers,sunglasses,
watches,Jewelry,Electronics,NBA,NFL,NHL,MLB[/url]
shoes
clothing
Handbags Wallets
Hat
Sunglasses
Belts
Watches
Jewelry
zzw08
 
Posts: 53
Joined: Tue Jul 14, 2009 5:15 am


Return to Bugs

Who is online

Users browsing this forum: No registered users and 0 guests

cron