[Que]How to express the variable in this example?
I want to know how to express this variable in this example in the red part
/* Variables */
$old=$row_rs_archive['old'];
$new=$row_rs_archive['new'];
$total=$old+$new;
echo $total;
if (array_key_exists('doit', $_POST)) {
$done = mysql_query('UPDATE temp SET cur_total = $total') or die(mysql_error());
echo works fine and show the total value , but in the UPDATE command , it doesn't work ,
I get this error
1500 Unknown column '$total' in 'field list'
notice 1500 comes from echo $total
Thanks...
I only took a quick glance, but I suspect it is because you're using single quotes for the query string. PHP will not parse variables in single quotes and will treat it as a literal string.
Try this:
$done = mysql_query("UPDATE temp SET cur_total = $total") or die(mysql_error());
If that doesn't quite get you there, try concatenation instead.
Similar Messages
-
How to use the variables used in the message mapping
Hi ,
In the message mapping we can declare variables in the JAVA section , these variables could be used across the mapping .
I have tried using it but I am unable to retrieve the values assigned to the variables in one UDF into the another UDF .
Please guide me how to use the variables declared in the JAVA section in the message mapping .
Thanks
Anita YadavAnita,
I have worked on the Global variables and i found no issues. Make sure that the variable is declared in the Declaration Section and then initlaized in the Initialization section.
If you declare a variable in the Declaration Section ,
int i;
then in any udf you can use if directly. No need to re declare the variable in the UDF. If you do this, then it becomes a local variable.
Regards,
Bhavesh -
How to clear the variable value in session store?
I'll try to build form for search. There are LOV and
search button on form. When user don't select anything then push
search button, I'd like the report to show query everything. I
mean the report will show like condition where id like '%'.
And I send variable between form to report by using session
store.
I select nothing in LOV but value that return by LOV is
not null. It's in stead of old value of LOV.
Please tell me.. How to clear the variable value in
session store? I'd like to set it to null. If you have greater
way to do like this, please tell me.
Thank you.Please suggest on this..
Thanks. -
How to use bind variables in this procedure
Hi Experts,
How to use bind variables in this procedure for static queries.
PROCEDURE DELETE_MER_PROC (M_id IN NUMBER)
IS
BEGIN
V_date DATE;
SELECT PD_DATE INTO v_date FROM PD_MAINTAIN;
DELETE FROM MER_CLEAR
WHERE MER_DT < v_date
AND ID = M_ID;
COMMIT;
END;
How to use v_date and m_id as bind variables in this procedure to avoid hard parsing.
Please help me.
Thanks.976208 wrote:
How to use v_date and m_id as bind variables in this procedure to avoid hard parsing.
You cannot avoid hard parsing - as the 1st time a SQL statement (like the SELECT or DELETE statements in your code) is encountered, it does not reside in the server's Shared Pool, and needs to be added into the pool via a hard parse.
Bind variables does not prevent hard parsing. Hard parsing happens when the SQL statement (with or without bind variables) is a brand new statement encountered by the server.
Bind variables enables the same SQL cursor to be reused, by simply changing the bind variable value.
Not using bind variables means that each SQL statement is unique and not shareable - as the value is hardcoded into the statement and cannot be changed via a bind value. This typically means LOTS of different SQL statements (where the only difference is the changed value in the statement) are created - with each statement being a new statement not seen before in the Shared Pool and needing to be hard parsed.
One does not design one's code not to be hard parsed. There ALWAYS will be a hard parse in order to get a SQL statement into the Shared Pool. One designs one's code to REUSE cursors in the Shared Pool. -
How to express the unsigned byte in Java?
we know that data are normally in unsigned byte format when communicating with COMM. How to express the unsigned byte in Java? java only supports 127 ~ -127 as byte, but I need 255~0.
Anyone know how?
Thanks!You mean when a byte ( -127) converts to a int, it
will become 255?In your example -1 will be printed in both cases because of the implicit conversion Java makes. The 0xff in the byte will become 0xffffffff in the int. Both are interpreted as -1.
This will keep the byte bitpattern intact and print -1 and 255.
byte b = (byte)(0xff);
int i = (b & 0xff); // mask of rightmost 8 bits
System.out.println(i); -
How to display the variable content in message?
Hi anybody
please let me know How to display the variable content in message?
please send few lines of sample code to understand that
thanks in advanceHi,
Check out the link
http://help.sap.com/saphelp_nw70/helpdata/en/2c/840b42202cce6ce10000000a155106/content.htm
REPORT Y9020027 LINE-SIZE 130. "Release 3.1G, 4.5A
BREAK-POINT.
MOVE: 'TESTREPORT for "ASSIGN FFeld+o(l) TO " '
TO SY-TITLE.
Declaration of variables **********************
FIELD-SYMBOLS <FS1>.
DATA: FFELD8(8) TYPE F VALUE '1022333'. "Unusual: Explicit 8 bytes
*DATA: ZFELD1(2) TYPE N. "Here slack bytes are (DW border)
"necessary
"If you like computing error, please uncomment the above
DATA: FFELDX(8) TYPE F VALUE '7777777'.
DATA: FFELDA(8) TYPE F VALUE '7333213'.
DATA: NFELDX(400) TYPE N.
DATA: OFFX(4) TYPE I VALUE 160.
DATA: LENX(4) TYPE I VALUE 8.
Main Section *******************
SKIP.
WRITE: /5 'Example 1 **** inadmissible ASSIGN ***' COLOR 6.
WRITE: /10 'Inadmissible ASSIGN: ''ASSIGN FFELD4+1(3) TO <FS1>'' '.
ASSIGN FFELD4+1(3) TO <FS1>.
ULINE.
SKIP 2.
SKIP.
ASSIGN FFELD8+8(8) TO <FS1>. "<-- Assigning of variable FFELDX !!
BREAK-POINT.
WRITE: / 'ASSIGN command with FFELD8, but FFELDX will be assigned'
COLOR 3.
WRITE: /5 'Example 2'.
PERFORM DISPLAY-FFELD USING FFELD8 'FFELD8'.
WRITE: /10 'Content of FFELDX :', FFELDX.
ULINE. SKIP 2.
SKIP.
ASSIGN FFELD8+16(8) TO <FS1>. "<-- Assiging a few FFELDA to <FS1>
BREAK-POINT.
WRITE: / 'ASSIGN with FFELD8, but instead FFELDA is assigned'
COLOR 3.
WRITE: /5 'Example 3'.
WRITE: /10 'Content of FFELDA :', FFELDA.
PERFORM DISPLAY-FFELD USING FFELD8 'FFELD8'.
WRITE: /10 'Content of FFELDA :', FFELDA.
ULINE. SKIP 2.
BREAK-POINT.
DO 4 TIMES.
ASSIGN FFELD8+OFFX(LENX) TO <FS1>. "Zuordnung auf OFFX zu <FS1>
WRITE: / 'ASSIGN command with FFELD8, es wird NFELDX zugeordnet'
COLOR 5.
WRITE: /5 'Example 4', 'DO-Schleife Nr.:', SY-INDEX.
PERFORM DISPLAY-FFELD USING FFELD8 'FFELD8'.
WRITE: /10 'Content of NFELDX145(40) :', NFELDX145(40).
ULINE. SKIP 2.
ADD 8 TO OFFX.
ENDDO.
Subroutines *******************
Display of data fields and field symbols *
FORM DISPLAY-FFELD USING FFELD FNAME.
WRITE: /10 'Content of', FNAME, ':', FFELD.
PERFORM FELDEIGENSCHAFTEN USING FFELD.
WRITE: /10 'Content of <FS1> :', <FS1>.
PERFORM FELDEIGENSCHAFTEN USING <FS1>.
ADD 111 TO <FS1>. "<-- Das Feldsybmol wird verwendet
WRITE: /10 'ADD 111 TO <FS1>'.
ULINE.
WRITE: /10 'Content of', FNAME, 35 ':', FFELD.
WRITE: /10 'Content of <FS1>', 35 ':', <FS1>.
ENDFORM.
Determination of field properties (only for information) *
FORM FELDEIGENSCHAFTEN USING ALLG.
DATA: FLAENGE(2) TYPE N.
DATA: FTYP(1) TYPE C.
DATA: FOUT(2) TYPE N.
DATA: FDEZ(2) TYPE N.
ULINE.
DESCRIBE FIELD ALLG LENGTH FLAENGE.
WRITE: /10 'Field length :', FLAENGE.
DESCRIBE FIELD ALLG TYPE FTYP.
WRITE: /10 'Field type :', FTYP.
DESCRIBE FIELD ALLG OUTPUT-LENGTH FOUT.
WRITE: /10 'Output length :', FOUT.
DESCRIBE FIELD ALLG DECIMALS FDEZ.
WRITE: /10 'Decimals :', FDEZ.
SKIP 1.
ENDFORM.
END OF PROGRAM ************************************* -
Hello!
I have a problem, because when the message appeared:
(original)
"Zabezpieczenia
Zażądano połączenia szyfrowanego ze stroną, która zawiera elementy niezaszyfrowane.
Prawdopodobieństwo odczytania przesyłanych danych przez osoby trzecie jest duże.
[Opcja] Zawsze ostrzegaj przed nawiazaniem połączenia szyfrowanego ze stroną zawierającą elementy niezaszyfrowane."
(in translation)
"Security
Requested an encrypted connection to a page that contains the elements unencrypted.
Probability of read data transmitted by third parties is large.
[Optional] Always warn me before you make an encrypted connection to the page containing the unencrypted parts."
option "Always warn ..." is disabled by default and by chance it shut off permanently.
How to restore the appearance of this message?
Sincerely,
Jadwiga ZabagłoHello!
I have a problem, because when the message appeared:
(original)
"Zabezpieczenia
Zażądano połączenia szyfrowanego ze stroną, która zawiera elementy niezaszyfrowane.
Prawdopodobieństwo odczytania przesyłanych danych przez osoby trzecie jest duże.
[Opcja] Zawsze ostrzegaj przed nawiazaniem połączenia szyfrowanego ze stroną zawierającą elementy niezaszyfrowane."
(in translation)
"Security
Requested an encrypted connection to a page that contains the elements unencrypted.
Probability of read data transmitted by third parties is large.
[Optional] Always warn me before you make an encrypted connection to the page containing the unencrypted parts."
option "Always warn ..." is disabled by default and by chance it shut off permanently.
How to restore the appearance of this message?
Sincerely,
Jadwiga Zabagło -
Please help me how to improve the performance of this query further.
Hi All,
Please help me how to improve the performance of this query further.
Thanks.Hi,
this is not your first SQL tuning request in this community -- you really should learn how to obtain performance diagnostics.
The information you posted is not nearly enough to even start troubleshooting the query -- you haven't specified elapsed time, I/O, or the actual number of rows the query returns.
The only piece of information we have is saying that your query executes within a second. If we believe this, then your query doesn't need tuning. If we don't, then we throw it away
and we're left with nothing.
Start by reading this blog post: Kyle Hailey &raquo; Power of DISPLAY_CURSOR
and applying this knowledge to your case.
Best regards,
Nikolay -
How to create the variable variant in process chains for ip
how to create the variable variant in process cahins for ip
Hi venky,
check these links
http://help.sap.com/saphelp_nw70/helpdata/EN/c0/980398e58611d194cc00a0c94260a5/content.htm
http://help.sap.com/saphelp_nw70/helpdata/EN/c0/98038ce58611d194cc00a0c94260a5/content.htm
bhaskar -
I need to know how to disable the forget about this site feature.
I have disabled the inprivate browsing feature and I need to know how to disable the forget about this site feature. I have a teenager and this is not a feature that I want available.
Some info here (group policy) --> http://www.unidesk.com/blog/how-disable-firefox-auto-updates<br />
Above article refers to --> http://sourceforge.net/projects/firefoxadm/
'''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.''' -
HT4623 i have iOS 4.2.1 in 3G old one. how to get the applications for this iOS
i have iOS 4.2.1 in 3G old one. how to get the applications for this iOS
look at this thread
https://discussions.apple.com/message/22837309#22837309 -
How to get the variable value in a flatfile
I have some 2 line string in a variable I wanted to see this value in a flat file.
Thanks,
NarthanHi Narthan,
If I understand correctly, you want to use some variables in a Flat File Connection Manager. If in this case, we can use variables in a Property of Flat File Connection Manager. For more details, please refer to the following steps:
Click the Flat File Connection Manager in Connection Manager tab, then navigate to Properties window.
Click “…” next to the Expressions property to open the Property Expressions Editor.
In the Property Expressions Editor dialog box, select the corresponding property at the Property drop-down list.
Click “…” next to the Expressions property to open the Expression Builder, then expand Variables and Parameters folder to select the variable.
Reference:
http://www.mssqltips.com/sqlservertip/1084/dynamic-flat-file-connections-in-sql-server-integration-services/
If there are any misunderstanding, please elaborate the issue for further investigation.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
How to get the variable value in description if I am writing a condition
I have created a query for TOP N Customers and
and for N I am passing as a varaible
& I want the same value to be displayed in the description
I tried a lot but I dont know how to do it
can any one tell me the solution for this
Thx & regardsHi,
You have to define a Text Variable of type customer exit and pass the value of the Variable you have created for the condition in the Exit Code.
You have to use the correct I_Step = *.
Cheers.
Ranga. -
How to change the variable value for the SCript in debugging
I have a variable &KNA1-NAME4&
i want to change the value of this variable in debugging mode
can any one please tell me how to do in step by steb mode.Hi Ravi,
In script u can't change the value in debigging. Open ur print program(If u don't know check TNAPR table).
Search for the element name where u r printing this variable. U can see some thing like
CALL FUNCTIOn 'WRITE_FORM'
element = ur element name.
Keep break point here and when u issue output control stops here. Now change the value as we does in normal reports.
Thanks,
Vinod. -
How to use the variable value "ALL"
Hello all,
I'm trying to use the value "all" for a selection variable in a Web Interface so that to have no restrictions for that specific variable and that all the rows are shown on the interface.
Unfortunately it does not seem to be working because when I select the value "all" the system seems to go back to the latest rows saved under a specific value for that variable and does not show all the rows saved under any variable's value.
Anyone knows how to make this work? One option is to remove the variable from the web interface altogether, but that's my last option.
Thanks in advance.
Best regards,
FrancescoHi Francesco,
why is leaving out the variable your last option? If you want to select "all" then you don´t need a variable.
Cornelia
Maybe you are looking for
-
Error in using ABAP OLE wrong cell value
Dear All.. I'm facing a problem while using ABAP OLE.. the problem is the ABAP OLE writes the wrong value in Excel file the value is 121.000 but it written in Excel file : 121 the weird thing is .. other value of 9.000.000 written correctly in Excel
-
Dear Cisco-Team, There are already some threads open regarding the implementation of new features. Some of them are maybe not more actual, so I open a new discussion to have hopefully answers on the following feature requests: PPTP-Implementation: It
-
I download firefox on windows 7 and it will not load a window comes up and says searching for ad ons
when the window comes up saying searching for add ons it just sits there and does nothing for hours
-
A question before I buy a Zen Mic
I was wondering if you can use the zen micro with itunes. Sense most of my songs were bought off of itunes. Thanks in advance.Message Edited by masterchief35 on 05-06-2005 06:05 AMMessage Edited by masterchief35 on 05-06-2005 06:06 AM
-
Website Issues with Retina Displays
An apple rep stated, that "Yes, some websites are not very clear when viewed with a retina display." He wouldn't elaborate further. So, is this a problem? If it is, how major of one is it? Also, is there a real difference between the retina display a