J
|
Jane 2/26/2008 |
Hi, $str = "<input type=button class=button value=insert onclick=\"windiw.location='tablename_edit.php?editid1=".$_REQUEST["editid1"]."&insert=yes'\">";
|
C
|
ckapote author 2/26/2008 |
Hi, you can do it using custom event on the Visual Editor tab (Insert PHP code snippet option). Here is a sample: Then check $_REQUEST["insert"] variable in the Edit page: Before process event and execute your query.
|
J
|
Jane 2/27/2008 |
Hi, global $conn; if ($_REQUEST["insert"]=="yes") { $strInsert = "insert into TableName (FieldName1,FieldName2) values (Value1,Value2)"; db_exec($strInsert,$conn); }
|
C
|
ckapote author 2/27/2008 |
Thanks one again , but iam not familiar how to write and execute the query . can you Help ? please
|
J
|
Jane 2/27/2008 |
Hi, global $conn; $str = "select * from table1 where category='provisions' and username='".$_SESSION["UserID"]."'"; $rs = db_query($rs,$conn); $data = db_fetch_array($rs); //$data["fieldname1"] - value of fieldname1 field //$data["fieldname2"] - value of fieldname2 field
|
C
|
ckapote author 2/27/2008 |
Hi, to select all records from table1 use this code: where category and username are your actual field names.
|