For eg., i have alphanumeric string 'ABCDEF 0 0.450' and i need to get '0.450' as numeric decimal and do arithmetic on it. Do we have a way? Please suggest.
I get:
"Resource id #8
Warning: mysql_fetch_array() expects parameter 1 to be resource, string given"
Heres the code:
$sql="SELECT password FROM user WHERE userid=$userid";
echo $password=mysql_query($sql);
while($row = mysql_fetch_array($password)) {
$password = $row['password'];
}
Any ideas?
I have a JsonResult that is working fine, and returning JSON from some POCO's. I want to save the JSON as a string in a DB.
public JsonResult GetJSON()
{
JsonResult json = new JsonResult
{
Data = GetSomPocos()
};
return json;
}
I need to audit the response, so I want to save the json into a DB. I am having trouble finding a way to get the JSON as a string.
Any help is appreciated.
How to get ride of all BBcodes in a string but keep the content?
Example:
[B]This is bold[/B] and This is [color=#FFCCCC]colored[/color]
Will be :
This is bold and This is colored
I have a hex string(lenght 48 chars) i want to convert to raw bytes with the pack function in order to put in in win32 vector of bytes.
could someone help how i can do this with perl ?
How to Find more than one string with Excel with the graphical interface?
For example, I am looking for the cells which is contained both strings Paul and John?
Hi.
I get from another class string that must be converted to char. It usually contains only one char and that's not a problem. But control chars i receive like '\n' or '\t'.
Is there standard methods to convert this to endline or tab char or i need to parse it myself?
Is following array initialization correct? I guess it is, but i'm not really sure if i can use const char* or if i better should use std::string. Beside the first question, do the char pointers point to memory segments of same sizes?
struct qinfo
{
const char* name;
int nr;
};
qinfo queues[] = {
{"QALARM", 1},
{"QTESTLONGNAME", 2},
{"QTEST2", 3},
{"QIEC", 4}
};
HI,
I have a string:
NEW ALPINESTAR?S SMX PLUS WHITE
MOTORCYCLE BOOTS! 44/9.5$349.95 Time
Left 1h 2m NEW AGV BLADE FLAT MATTE
WHITE LARGE/LG HELMET$75.53Time Left
1h 2m
I want result in array like this:
Productname
Price time NEW ALPINESTAR?S SMX
PLUS WHITE MOTORCYCLE BOOTS! 44/9.5
$349.95 Time Left 1h 2m
How can i pass a string delimited by space or comma to stored procedure and filter result?
I'm trying to do something like -
Parameter Value
--------------------------
@keywords key1 key2 key3
Then is stored procedure i want to first
find all records with first or last
name like key1
filter step 1 with first or last
name like key2
filter step 2 with first or last name like key 3
I have time from DB:
string user_time = "17:10:03"; //Hours:minutes:seconds
DateTime time_now = DateTime.Now;
How do I compare the time? How make same like this:
if(time_now > user_time)
{
//Do something
}
else
{
//Do something
}
Hello,
I want to know how to echo a string that have a $ sign from a database. At this time, the value on database 'Buy one for $5.00' converts to 'Buy one for .00'.
Ex:- Field: title | Value: Buy one for $5.00
<?php
$row = mysql_fetch_array.....
$title = $row['title'];
echo $title;
?>
Thank you, pnm123
In my code I need to compare string letters but my problem is that lower case letters are greater than upper case letter.
For example Z < a.
How could I implement this in my code ?
Thanks
I am using spring mvc in which i convert the arraylist into json string. I have one object 1) results.
My output from spring looks like this:
{
"data":"[{\"userName\":\"test1\",\"firstName\":\"test\",\"lastName\":\"user\"}, {\"userName\":\"test2\",\"firstName\":\"test1\",\"lastName\":\"user1\"}]",
}
I get output as null when i do '$.parseJSON' with this output. When i tried testing only with data object it works fine
Any help would be great.
Hi all,
i have a little question ,i have a NSString object
(\n "1 Infinite Loop",\n "Cupertino, CA 95014",\n USA\n)
and i want the Cupertino from this string
Till now i have used stringByReplacingOccurrencesOfString: and able to get "1InfiniteLoop""CupertinoCA95014"USA
But still not able get Cupertino.
Do any other method able to solve this problem?
Hi, I have a string and I want to check if it represents a proper namespace, eg. System.IO is ok, but System.Lol is not.
I guess some reflection should be used, but I can't figure this out.
Any thoughts?
Given a string named line whose raw version has this value:
\rRAWSTRING
how can I detect if it has the escape character \r? What I've tried is:
if repr(line).startswith('\r'):
blah...
but it doesn't catch it. I also tried find, such as:
if repr(line).find('\r') != -1:
blah
doesn't work either. What am I missing?
thx!
Hi. Is there a way to convert '@my_variable' string into a value of @my_variable?
I have a table which stores names of variables. I need to get the value of this variable. Something like this:
DECLARE @second_variable AS NVARCHAR(20);
DECLARE @first_variable AS NVARCHAR(20);
SET @first_variable = '20';
SET @second_variable = SELECT '@first_variable'; --here I want that @second variable be assigned a value of "20".
Hi All,
here is me requirement.
I have one text file and I need to get exact specified string from that file
C:>type small.txt | find "small2"
small2
small22
small20
C:>type small.txt small2
small22
small20
C:>type small.txt | find "small2" small2
small22
small20
C:\
Here it is giving all the words instead of only "small2"
Plz help me in this.. it's urgent
Thanks in advance
I have a question about converting types. I want to change the currently selected combobox value string to an int, but I get errors
My code:
int.Parse(age.SelectedItem.ToString());
What can I do for this problem?
How can I split a string only once, i.e. make "1|Ceci n'est pas une pipe: | Oui" parse to: ["1", "Ceci n'est pas une pipe: | Oui"]?
The limit in split doesn't seem to help...