Getting SQL*Net more data from client waits when running a query through web based interface
Hi, you all,
We are having this weird behavior when running query through web based interface, we get a lot of "SQL*Net more data from client" waits, the OEM indicates that the current wait event is SQL*Net more data from client
It's just a very simple query wich invokes a db link.
When I execute the same query on any PL/SQL tool like toad or sql developer it works fine, but that query inside an application executed through a web based interface, it hangs for ever.
Where can I start looking for the problem.
We are working on a 3 Node RAC 11gr2, both databases are on the same RAC.
Thanks.
Hi ,
we managed to reproduce the case in test environment, below are the steps:
1)have 2 databases on different machines, will call the first one local, the other one remote.
2)in the local database create:
a - DBLink to remote database.
b - read data from remote database(we simply used select count(*) from dummy_table )
c - insert data into a table on the local database
d - terminate the connection between the 2 databases (disconnect either machine from the network)
e - commit on local database.
what we noticed was the following:
1)when the local database is disconnected from the network(the machine is not connected to any network at the moment): almost immediately throws an error, and issuing the following:
select * from dba_2pc_pending;we found some data .
2) when the remote database was disconnected(the local database is still connected to the network):
after 7-8 seconds an error is thrown, and issuing the following:
select * from dba_2pc_pending;did not return any data.
since this is pretty similar to our case ,we concluded that it's a network issue.
is this the correct behavior ?
as a temporary solution till the network issue is fixed ,we did the following:
1) changed the call of the remote procedure to calling a local procedure that calls the remote procedure.
2) added pragma autonomous_transaction to the local procedure.
3) at the end of the local procedure rollback the autonomous transaction.
it seems that since the global transaction does not use the DBLink database does not issue a 2PC commit.
this works in my cases since the DBLink is only issed to read data.
Similar Messages
-
SQL*Net more data to dblink event for hours or days
Hello Everyone,
in our production database when we commit a transaction we call a remote procedure over dblink.
usually the call succeeds ,but every now and then a couple of sessions hang up,
when I use the session browser of Toad I notice that these sessions are waiting with the event SQL*Net more data to dblink
below are some queries and their results:
select sid,event,wait_class,wait_time,seconds_in_wait,state from gv$session_wait where sid=225
rslt:
225 SQL*Net more data to dblink Network -1 18279 WAITED SHORT TIME
select * from gv$session_wait_history where sid=225
rslt:
INST_ID SID SEQ# EVENT# EVENT P1TEXT P1 P2TEXT P2 P3TEXT P3 WAIT_TIME WAIT_TIME_MICRO TIME_SINCE_LAST_WAIT_MICRO
2 225 1 344 SQL*Net more data to dblink driver id 1413697536 #bytes 8144 0 0 8 41
2 225 2 344 SQL*Net more data to dblink driver id 1413697536 #bytes 8143 0 0 13 39
2 225 3 344 SQL*Net more data to dblink driver id 1413697536 #bytes 8149 0 0 7 37
2 225 4 344 SQL*Net more data to dblink driver id 1413697536 #bytes 8145 0 0 8 40
2 225 5 344 SQL*Net more data to dblink driver id 1413697536 #bytes 8145 0 1 11394 37
2 225 6 344 SQL*Net more data to dblink driver id 1413697536 #bytes 8143 0 0 7 37
2 225 7 344 SQL*Net more data to dblink driver id 1413697536 #bytes 8145 0 0 7 36
2 225 8 344 SQL*Net more data to dblink driver id 1413697536 #bytes 8138 0 0 8 37
2 225 9 344 SQL*Net more data to dblink driver id 1413697536 #bytes 8149 0 0 8 38
2 225 10 344 SQL*Net more data to dblink driver id 1413697536 #bytes 8149 0 1 11476 37I'm not sure but from the above results ,is it safe to conclude that I get stuck because I am caught in infinite loop trying to write to dblink?
additional notes:
<li>some times when I look at the current statement I find that the statement is a query or insert into a local table.
<li>there were some network outages.
<li>when viewing the database log files I found:Error 3135 trapped in 2PC on transaction 7.6.306086. Cleaning up.
Error stack returned to user:
ORA-03135: connection lost contact
ORA-02063: preceding line from MPF//where MPF is the name of dblinkeven though we use the DBLink to execute the procedure only without any changes on the remote DB, and we don't use 2PC.
<li> the local DB is a RAC
select * from dba_blockers
rslt:
no rows
select * from dba_waiters
rslt:
no rows
select * from gv$lock where sid=225
rslt:
INST_ID ADDR KADDR SID TYPE ID1 ID2 LMODE REQUEST CTIME BLOCK
2 0000000199D54F60 0000000199D54FB8 225 AE 100 0 4 0 20152 2
2 000000018EA18108 000000018EA18180 225 TX 1114138 251539 6 0 19654 2
select * from gv$session where sid=225
rslt:
INST_ID SADDR SID SERIAL# AUDSID PADDR USER# USERNAME COMMAND OWNERID TADDR LOCKWAIT STATUS SERVER SCHEMA# SCHEMANAME OSUSER PROCESS MACHINE PORT TERMINAL PROGRAM TYPE SQL_ADDRESS SQL_HASH_VALUE SQL_ID SQL_CHILD_NUMBER SQL_EXEC_START SQL_EXEC_ID PREV_SQL_ADDR PREV_HASH_VALUE PREV_SQL_ID PREV_CHILD_NUMBER PREV_EXEC_START PREV_EXEC_ID PLSQL_ENTRY_OBJECT_ID PLSQL_ENTRY_SUBPROGRAM_ID PLSQL_OBJECT_ID PLSQL_SUBPROGRAM_ID MODULE MODULE_HASH ACTION ACTION_HASH CLIENT_INFO FIXED_TABLE_SEQUENCE ROW_WAIT_OBJ# ROW_WAIT_FILE# ROW_WAIT_BLOCK# ROW_WAIT_ROW# TOP_LEVEL_CALL# LOGON_TIME LAST_CALL_ET PDML_ENABLED FAILOVER_TYPE FAILOVER_METHOD FAILED_OVER RESOURCE_CONSUMER_GROUP PDML_STATUS PDDL_STATUS PQ_STATUS CURRENT_QUEUE_DURATION CLIENT_IDENTIFIER BLOCKING_SESSION_STATUS BLOCKING_INSTANCE BLOCKING_SESSION FINAL_BLOCKING_SESSION_STATUS FINAL_BLOCKING_INSTANCE FINAL_BLOCKING_SESSION SEQ# EVENT# EVENT P1TEXT P1 P1RAW P2TEXT P2 P2RAW P3TEXT P3 P3RAW WAIT_CLASS_ID WAIT_CLASS# WAIT_CLASS WAIT_TIME SECONDS_IN_WAIT STATE WAIT_TIME_MICRO TIME_REMAINING_MICRO TIME_SINCE_LAST_WAIT_MICRO SERVICE_NAME SQL_TRACE SQL_TRACE_WAITS SQL_TRACE_BINDS SQL_TRACE_PLAN_STATS SESSION_EDITION_ID CREATOR_ADDR CREATOR_SERIAL# ECID
2 00000001993E4F58 225 445 1353611 0000000198E2FA10 198 <schema> 47 2147483644 000000018EA18108 ACTIVE DEDICATED 198 <schema> oracle 1234 <cluster name> 49993 unknown JDBC Thin Client USER 00000001968A1250 3198676106 72y8ztfzagv4a 2 02/04/2013 11:18:22 ص 33554852 00000001968A18E0 3992616824 03mm4u3qznzvs 0 02/04/2013 11:18:22 ص 33554730 158207 1 158207 1 JDBC Thin Client 2546894660 0 12206 122409 8 49354 0 94 02/04/2013 10:53:20 ص 19559 NO NONE NONE NO DISABLED ENABLED ENABLED 0 NOT IN WAIT NOT IN WAIT 42844 344 SQL*Net more data to dblink driver id 1413697536 0000000054435000 #bytes 8144 0000000000001FD0 0 00 2000153315 7 Network -1 19553 WAITED SHORT TIME 8 19553325216 SYS$USERS DISABLED FALSE FALSE FIRST EXEC 100 0000000198E2FA10 2 004qLk^iPyp0bqw5wFDCiW0002fR000B^fHi ,
we managed to reproduce the case in test environment, below are the steps:
1)have 2 databases on different machines, will call the first one local, the other one remote.
2)in the local database create:
a - DBLink to remote database.
b - read data from remote database(we simply used select count(*) from dummy_table )
c - insert data into a table on the local database
d - terminate the connection between the 2 databases (disconnect either machine from the network)
e - commit on local database.
what we noticed was the following:
1)when the local database is disconnected from the network(the machine is not connected to any network at the moment): almost immediately throws an error, and issuing the following:
select * from dba_2pc_pending;we found some data .
2) when the remote database was disconnected(the local database is still connected to the network):
after 7-8 seconds an error is thrown, and issuing the following:
select * from dba_2pc_pending;did not return any data.
since this is pretty similar to our case ,we concluded that it's a network issue.
is this the correct behavior ?
as a temporary solution till the network issue is fixed ,we did the following:
1) changed the call of the remote procedure to calling a local procedure that calls the remote procedure.
2) added pragma autonomous_transaction to the local procedure.
3) at the end of the local procedure rollback the autonomous transaction.
it seems that since the global transaction does not use the DBLink database does not issue a 2PC commit.
this works in my cases since the DBLink is only issed to read data. -
SQL*Net break/reset to client wait event
Hi,
Can you please explain me about "SQL*Net break/reset to client" wait event. One of my session was waiting for this event and when I looked which is causing the problem there are many duplicates in the input which were geting rejecting due ot the primary key. I didn't exactly get how the duplicate reject causing this wait event.
I appreciate your help !!
Thanks
Anand
Edited by: user509266 on Sep 4, 2009 10:58 AMBetter place to ask is over in the Database forums.
-
I only get sound and no picture when playing sky sports through my air play , Help ?
apps can choose to block mirror
try restarting wifi router, ipad and appletv and try again if it still don't work maybe the app is blocking mirror -
Query takes more time from client
Hi,
I have a select query (which refers to views and calls a function), which fetches results in 2 secs when executed from database. But takes more than 10 mins from the client.
The tkprof for the call from the client is given below. Could you please suggest, what is going wrong and how this can be addressed?
The index IDX_table1_1 is on col3.
Trace file: trace_file.trc
Sort options: exeela
count = number of times OCI procedure was executed
cpu = cpu time in seconds executing
elapsed = elapsed time in seconds executing
disk = number of physical reads of buffers from disk
query = number of buffers gotten for consistent read
current = number of buffers gotten in current mode (usually for update)
rows = number of rows processed by the fetch or execute call
SELECT ROUND(SUM(NVL((col1-col2),(SYSDATE - col2)
FROM
table1 WHERE col3 = :B1 GROUP BY col3
call count cpu elapsed disk query current rows
Parse 0 0.00 0.00 0 0 0 0
Execute 7402 0.27 7.40 0 0 0 0
Fetch 7402 1.13 59.37 1663 22535 0 7335
total 14804 1.40 66.77 1663 22535 0 7335
Misses in library cache during parse: 0
Optimizer mode: ALL_ROWS
Parsing user id: 32 (ORADBA) (recursive depth: 1)
Rows Execution Plan
0 SELECT STATEMENT MODE: ALL_ROWS
0 SORT (GROUP BY NOSORT)
0 TABLE ACCESS MODE: ANALYZED (BY INDEX ROWID) OF 'table1'
(TABLE)
0 INDEX MODE: ANALYZED (RANGE SCAN) OF 'IDX_table1_1'
(INDEX)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
db file sequential read 1663 1.37 57.71
OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 0 0.00 0.00 0 0 0 0
Execute 0 0.00 0.00 0 0 0 0
Fetch 0 0.00 0.00 0 0 0 0
total 0 0.00 0.00 0 0 0 0
Misses in library cache during parse: 0
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
db file sequential read 16039 3.09 385.04
db file scattered read 34 0.21 1.42
latch: cache buffers chains 26 0.34 2.14
SQL*Net break/reset to client 2 0.05 0.05
SQL*Net message to client 2 0.00 0.00
SQL*Net message from client 2 79.99 79.99
SQL*Net message to dblink 1 0.00 0.00
SQL*Net message from dblink 1 0.00 0.00
OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
call count cpu elapsed disk query current rows
Parse 0 0.00 0.00 0 0 0 0
Execute 7402 0.27 7.40 0 0 0 0
Fetch 7402 1.13 59.37 1663 22535 0 7335
total 14804 1.40 66.77 1663 22535 0 7335
Misses in library cache during parse: 0
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
db file sequential read 1663 1.37 57.71
1 user SQL statements in session.
0 internal SQL statements in session.
1 SQL statements in session.
1 statement EXPLAINed in this session.
Trace file: trace_file.trc
Trace file compatibility: 10.01.00
Sort options: exeela
1 session in tracefile.
1 user SQL statements in trace file.
0 internal SQL statements in trace file.
1 SQL statements in trace file.
1 unique SQL statements in trace file.
1 SQL statements EXPLAINed using schema:
ORADBA.prof$plan_table
Default table was used.
Table was created.
Table was dropped.
84792 lines in trace file.
4152 elapsed seconds in trace file.Edited by: agathya on Feb 26, 2010 8:39 PMI have a select query (which refers to views and calls a function), which fetches results in 2 secs when >executed from database. But takes more than 10 mins from the client.You are providing proof for the latter part of your statement above.
But not for the former part (fetches in 2 secs when exec'd from db).
It would have been nice if you also provide the sql-trace information for that.
Without it we cannot help you much. Other than making the observation that you obviously have a query that is I/O bound, and that I/O on your system is rather slow: on average an I/O takes 0.04 seconds (66.77 divided by 1663). -
Regarding Batch Jobs for migration of data from client DB to our local DB
Hi Folks,
GoodDay, Previously I worked as a Oracle Developer and recently shifted into a BIG organisation as PL?SQL developer. Here my base work is with INTERFACES(Stored Procedure). That is retrieving data from client DB and need to put the data in our staging tables. For that i created 2 INTERFACES(stored procedures). One is for one time migration. No need to run on regular basis. The second one is to run regularly why because if any updations are done in client DB that should be replicate to our DB. For that we need to run a BATCH JOB regulary 24X7 basis.
But i dont have any working knowledge on BATCH JOB creation and running. Please let me guide on this issue ASAP.
Regards,
Ramesh.You can try
dbms_job(9i)
or
dbms_scheduler(10g)
just out of curiosity.. tell me if you are interested...
what you were doing as a "oracle developer" ( is it like writing only "sql" )... -
Error 61 when sending data from client and back from server.vi
Trying to generate and send a data from client.vi and adding the numbers generated and sending it back to the client .In client the data is received only once and an error 61 occurs .How do I get rid of this error?I have attached the two files for reference
Attachments:
Sguruserver.vi 63 KB
client1.vi 100 KBYou can certainly use and application started by WebStart to send data to a server.
However, the Sandbox restrictions allow you to contact the server the application was loaded from without asking for permission first (i.e. signing your application and requesting the proper permissions in your JNLP file).
The JNLP BasicService can be used to retrieve the URL (and therefore the server) the application was loaded from. -
HTTP-500 Error Reading Data from Client!!
I'm trying to create a page where by clients are able to contact us through the portal. So, it's a pretty basic form where I have a text box for the subject, and a text area for the message body.
My problem is when the message body is over a certain size, I'm getting a "portlet cannot be contacted" on my screen. The Apache log comes up with the error:
[error] mod_plsql: /pls/portal/!PORTAL.wwpob_page.show HTTP-500 Error Reading Data from Client!!
I'm not using a windows OS, so the bug that has been talked about previously talked about shouldn't be the problem.
Also, I am using a POST rather than a GET, so I don't think it has to do with the browser (and I have tested this on Firefox and IE 5.5 and IE 6).
Would appreciate any advise.
Thanks, NickyAre you using SSL? Maybe, it has to do with it. I encountered a similar problem. It turned up that this read error occurred inside Apache and was caused by a nonstandard-SSL-request by Internet Explorer. te remedy was to add this to the Apache configuration:
SetEnvIf User-Agent ".*MSIE.*" \
nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
It tells Apache to switch to HTTP/1.0 and to never keep open socket connections with MSIE on SSL connections.
Lycka till! -
Populate SQL table with data from Oracle DB in ODI
Hi,
I am trying to populate a source SQL table with fields from an Oracle db in ODI. I am trying to perform this using a procedure and I am am getting the following error:
ODI-1226: Step PROC_1_Contract_Sls_Person_Lookup fails after 1 attempt(s).
ODI-1232: Procedure PROC_1_Contract_Sls_Person_Lookup execution fails.
ODI-1228: Task PROC_1_Contract_Sls_Person_Lookup (Procedure) fails on the target MICROSOFT_SQL_SERVER connection Phys_HypCMSDatamart.
Caused By: weblogic.jdbc.sqlserverbase.ddc: [FMWGEN][SQLServer JDBC Driver][SQLServer]Invalid object name 'C2C_APP.CON_V'.
My question is what is the best method to populate SQL db with data from an Oracle db? Using a procedure? A specific LKM?
I found threads referring to using an LKM to populate Oracle tables with data from a SQL table....but nothing for the opposite.
Any information would help.
thanks,
EricHi Eric,
If using an Interface, I would recommend the LKM SQL to MSSQL (BULK) knowledge module. This will unload the data from Oracle into a file, then bulk load the staging db on the target using a BULK INSERT.
Regards,
Michael Rainey -
I just got a new phone today the iphone 5c and i plugged it into itunes. i wanted to get all of my data from my iphone 4s but when i synced my phone all of my iphone 3 data was on my new phone how do i get my iphone 4 data on my new phone?
Did you choose the wrong back up? There should be a drop box when you go to "Restore from Back up" in iTunes and your iPhone is plugged in, on the Summary page. Choose the correct back up. If you can't find one, and you still have your device, back up your iPhone 4 again and then choose that back up. Or check for an old iCloud back up if you have one.
-
recently had to purchase a replacement phone a friend of mine had backed up the data on the lost phone to his Mac laptop how do I get that backed up data from the lost iPhone that's on his Mac laptop to my new replacement phone? Please give step by step instructions xoxoxo
And my iTunes sign in is also screwed up... It is underneath my friends email (the one with my backed up data on his Mac laptop) HOW DO I CHANGE THIS SO THAT I CAN DOWNLOAD APP's again...I suspect unless he had some items in iCloud backup then they are gone. Connecting an iPhone to a different library from that to which it was previously connected will result in the device asking if you want to erase it.
-
how do i get my songs and data from my old mac onto my pc so that i can copy it onto my new ipod touch
jrswish wrote:
When I plugged in my new one it cleared all my song and apps out of my current itunes.
Are you sure of that? Check in the Library. Click on the Apps icon to see all apps. Similarly click on the Music icon to see the songs. -
SCM APO can we copy the data from client 001 to client 002???
Hi Guru's
SCM APO can we copy the data from client 001 to client 002???
If it is possibulity please let me know?
Regards,
SreeYes you can do.
Tcode SCCL.
Options :
When copying clients, you can select what you want to transfer from the source client to the target client:
User masters: You select this option, for example, if you want to give all users of an existing client the same authorizations in the target client.
Client-specific Customizing: You select this option, for example, if you want to set up a new client in an existing system.
Client-specific Customizing and master/transaction data:
You select this option, for example, if you want to set up a test client that is identical to the production client (in the same system).
Client-specific and cross-client Customizing: You select this option, for example, if you want to set up a quality assurance system based on the production client of another system.
Client-specific and cross-client Customizing and master/transaction data: You select this option, for example, if you want to set up a test client based on the production client of another system.
http://help.sap.com/saphelp_46c/helpdata/EN/69/c24c4e4ba111d189750000e8322d00/frameset.htm -
How can get back my backup data from an external element ?
How can get back my backup data from an external element ?
See the section titled "restoring data from Time Machine backups" in this Apple support article; that should get you going.
http://support.apple.com/kb/ht1427
Regards. -
How can I enter the data from the recordset into your insert query
Hi
i would like to know how I can enter the data from the recordset into your insert query without using a hidden field.
thanks
------------------------------------------------------------------------------------Below is the code------------------------------------------------------------------------------------- -----
<?php require_once('../../Connections/ezzyConn.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
return $theValue;
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "frmpostComment")) {
$insertSQL = sprintf("INSERT INTO comments (com_topic, com_user, title, com_content, com_date, online_id) VALUES (%s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['com_topic'], "int"),
GetSQLValueString($_POST['commentby'], "int"),
GetSQLValueString($_POST['title'], "text"),
GetSQLValueString($_POST['com_content'], "text"),
GetSQLValueString($_POST['com_date'], "text"),
GetSQLValueString($_POST['online_id'], "int"));
mysql_select_db($database_ezzyConn, $ezzyConn);
$Result1 = mysql_query($insertSQL, $ezzyConn) or die(mysql_error());
$insertGoTo = "index.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
header(sprintf("Location: %s", $insertGoTo));
$colname_rsCommentby = "-1";
if (isset($_SESSION['MM_Username'])) {
$colname_rsCommentby = $_SESSION['MM_Username'];
mysql_select_db($database_ezzyConn, $ezzyConn);
$query_rsTopics = "SELECT topic_id, topic FROM topics ORDER BY topic_date DESC";
$rsTopics = mysql_query($query_rsTopics, $ezzyConn) or die(mysql_error());
$row_rsTopics = mysql_fetch_assoc($rsTopics);
$totalRows_rsTopics = mysql_num_rows($rsTopics);
mysql_select_db($database_ezzyConn, $ezzyConn);
$query_rsOnline = "SELECT online_id, `online` FROM `online` ORDER BY online_id DESC";
$rsOnline = mysql_query($query_rsOnline, $ezzyConn) or die(mysql_error());
$row_rsOnline = mysql_fetch_assoc($rsOnline);
$totalRows_rsOnline = mysql_num_rows($rsOnline);
$colname_rsCommentby = "-1";
if (isset($_SESSION['MM_Username'])) {
$colname_rsCommentby = $_SESSION['MM_Username'];
mysql_select_db($database_ezzyConn, $ezzyConn);
$query_rsCommentby = sprintf("SELECT user_id, username FROM users WHERE username = %s", GetSQLValueString($colname_rsCommentby, "text"));
$rsCommentby = mysql_query($query_rsCommentby, $ezzyConn) or die(mysql_error());
$row_rsCommentby = mysql_fetch_assoc($rsCommentby);
$totalRows_rsCommentby = mysql_num_rows($rsCommentby);
?>
<?php include("../includes/access.php"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ezzybay - easy click, ezzy shopping</title>
<link href="../css/global.css" rel="stylesheet" type="text/css" />
<link href="../css/navigation.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<?php include("../includes/top.php"); ?>
<div id="content">
<div id="pageTitle">
<h2>CMS Section:</h2>
<p>Comment Topics Page</p>
</div>
<?php include("../includes/leftnav.php"); ?>
<div id="mainContent">
<form action="<?php echo $editFormAction; ?>" method="post" name="frmpostComment" id="frmpostComment">
<table align="center">
<caption>Post Comment</caption>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Topic:</td>
<td><select name="com_topic" class="listbox" id="com_topic">
<?php
do {
?>
<option value="<?php echo $row_rsTopics['topic_id']?>"><?php echo $row_rsTopics['topic']?></option>
<?php
} while ($row_rsTopics = mysql_fetch_assoc($rsTopics));
$rows = mysql_num_rows($rsTopics);
if($rows > 0) {
mysql_data_seek($rsTopics, 0);
$row_rsTopics = mysql_fetch_assoc($rsTopics);
?>
</select></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Title:</td>
<td><input name="title" type="text" class="textfield" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right" valign="top">Comment:</td>
<td><textarea name="com_content" cols="50" rows="5" class="textarea"></textarea></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Status:</td>
<td><select name="online_id" class="smalllistbox">
<?php
do {
?>
<option value="<?php echo $row_rsOnline['online_id']?>" <?php if (!(strcmp($row_rsOnline['online_id'], 2))) {echo "SELECTED";} ?>><?php echo $row_rsOnline['online']?></option>
<?php
} while ($row_rsOnline = mysql_fetch_assoc($rsOnline));
?>
</select></td>
</tr>
<tr> </tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"> </td>
<td><input type="submit" class="button" value="Insert record" /></td>
</tr>
</table>
<input name="commentby" type="hidden" id="commentby" value="<?php echo $row_rsCommentby['user_id']; ?>" />
<input type="hidden" name="com_date" value="<?php echo date("d/m/y : H:i:s", time()) ?>" />
<input type="hidden" name="MM_insert" value="frmpostComment" />
</form>
</div>
</div>
<?php include("../includes/footer.php"); ?>
</div>
</body>
</html>
<?php
mysql_free_result($rsTopics);
mysql_free_result($rsOnline);
mysql_free_result($rsCommentby);
?>I'll keep it simple and only use the date as an example. Hopefully you get the concept from the example. Basically you create a recordset and insert the recordset value instead of the POST value into your insert query. In the example below I declared a variable for $the_date and entered the variable into the INSERT query instead of the hidden POST field.
<?php require_once('../../Connections/ezzyConn.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
return $theValue;
$the_date = date("d/m/y : H:i:s", time());
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "frmpostComment")) {
$insertSQL = sprintf("INSERT INTO comments (com_topic, com_user, title, com_content, com_date, online_id) VALUES (%s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['com_topic'], "int"),
GetSQLValueString($_POST['commentby'], "int"),
GetSQLValueString($_POST['title'], "text"),
GetSQLValueString($_POST['com_content'], "text"),
GetSQLValueString($the_date, "text"),
GetSQLValueString($_POST['online_id'], "int"));
mysql_select_db($database_ezzyConn, $ezzyConn);
$Result1 = mysql_query($insertSQL, $ezzyConn) or die(mysql_error());
$insertGoTo = "index.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
header(sprintf("Location: %s", $insertGoTo));
?>
Maybe you are looking for
-
WU_TEST_106 , client_text_io not working
I tried the demo webutil software, all the components are working except the client_text_io , which is on the second tab, writing to a text file from the screen. Reference data from Java Console Loading http://hostmachine:8889/forms90/java/f90all_jin
-
How to run D2k 32 bit Application on Windows 7 64 Bit
Dear Friends How to run D2k 32 bit Application on Windows 7 64 Bit, Presently I am having a Application developed in D2k 32 Bit, and it is running smooth on Windows Visa and Windows Xp. but now OUr company are going for new Laptops having Windows 7 6
-
Supplier collbration with SAP SNC
Any documentation on Supplier collbration with SAP SNC . Thanks Gayatri
-
Error in EJB client program (javax.naming.NoInitialContextException)
Hi folks , I'm new to j2ee programming and using Netbeans 5.5 , i created a session bean program and deployed successfully in JOnAS application server but i'm not able to run the client program which invokes session bean (EJB module ). when i run cli
-
Website Icons not displaying Correctly on FF8.0
Dear Support, After upgrading to the latest FF8.0, I noticed that some of the bookmarked websites in my bookmark toolbar don't display their icons correctly. for e.g.: I have Cisco.com at bookmark toolbar. Instead of displaying Cisco's logo next to t