Copy link to clipboard
Copied
I need to combine form and query codes but I couldnt make it.
This is my CFML codes
<cfform name="ADDADA" method="post" >
<table border="3">
<tr>
<td><strong>Musteri ID: </strong></td>
<td><input type="text" name="MHid" >
</td></tr><br>
<tr>
<td><strong>Musteri Hareket Aciklama: </strong></td>
<td><input type="text" name="MHaciklama"> </td></tr>
<br>
<tr>
<td><strong>Musteri Tipi: </strong></td>
<td><input type= "text" name="Mtipi"></td>
</tr>
</table>
<br><input type="submit" name="Kaydet" value="KAYDET">
</cfform>
<cfif IsDefined("form.MHid") and IsDefined("from.MHaciklama")>
<cfquery NAME="ADD" datasource= "DENEME" >
INSERT INTO musterihareketleri (MusteriID,Aciklama,MusteriTipi)
values (
<cfqueryparam cfsqltype="cf_sql_integer" value="#cfform.MHid#">,
<cfqueryparam cfsqltype="cf_sql_varchar" value="#cfform.MHaciklama#">,
<cfqueryparam cfsqltype="cf_sql_varchar" value="#cfform.Mtipi#">
)
</cfquery>
</cfif>
<cfquery name="ADD" datasource="DENEME">
select * from musterihareketleri ;
</cfquery>
<cfdump var="#ADD#">
Copy link to clipboard
Copied
While there are various curious coding practices in your code we might ask about, as for your "problem", could it be just the mistaken "from" for "form" in:
IsDefined("from.MHaciklama")>
If that's not it, please tell us the exact error or unexpected result you're getting.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
yes i did now i have this error
The error occurred in C:/xampp/htdocs/coldfusion/cfusion/wwwroot/new 2.cfm: line 25 |
23 : INSERT INTO musterihareketleri (ACIKLAMA, MUSTERIID, MUSTERITIPI) 24 : values ( 25 : <cfqueryparam cfsqltype="cf_sql_integer"" value="#cfform.MHid#">, 26 : <cfqueryparam cfsqltype="cf_sql_varchar" value="#cfform.MHaciklama#">, 27 : <cfqueryparam cfsqltype="cf_sql_varchar" value="#cfform.Mtipi#"> |
Copy link to clipboard
Copied
You will help us to show the actual error, not just where it points to. But I see a mistaken extra double quotes after the first "cf_sql_integer", at least in your last message (though not the first).
Copy link to clipboard
Copied
thanks for your help you are very kind
i found the error it was about the column names
Copy link to clipboard
Copied