nella speranza che sia il posto giusto....
sono nuovo di coldfusion e ho un """"Problemino"""" con la chiamata alle funzioni definite dall'utente, cioè da me stesso....![]()
Il codice della mia sempliciotta pagina è il seguente
<html>
<head>
<title>A ColdFusion Page</title>
</head>
<body>
<table>
<cffunction name="ricerca">
<cfargument name="stringa">
<cfquery name="sql2" datasource="cftest">
select * from tbl_news where (TITOLO like '%"#stringa#"%' or TESTO like '%"#stringa#"%')
</cfquery>
<cfreturn sql2>
</cffunction>
<table align="center" cellspacing="0" cellpadding="0" border="0" width="95%">
<form action="test.cfm" method="post">
<tr><td colspan="3"><input type="Text" name="stringa">
<input name="b1" type="submit" value="cerca">
</td></tr>
</form>
<cfif isdefined ("form.stringa")>
xcbxcb
<cfset sql=ricerca(form.stringa)>
<cfoutput query="sql">
<tr>
<td class="areeHome" width="33%" VALIGN="TOP"><span class="testo_piccolo">[img]images/pallino.gif[/img] [#Dateformat(data, "dd/mm/yyyy")#]</span></td>
<td class="areeHome" width="10" VALIGN="TOP">[img]images/spaziatore.gif[/img]</td>
<td class="areeHome" width="67%" VALIGN="TOP"><p align="justify"><span class="titolo_piccolo">#titolo#</span>
<span class="testo_piccolo">#testo#</span></td>
</tr>
<tr><td class="areeHome" colspan="3"></td></tr>
</cfoutput>
</cfif>
</table>
</body>
</html>
e io mi aspetto che, una volta immesso qualcosa nell'input text mi faccia una ricerca, cosa che effettivamente fa.
Ora, il primo dubbio ce l'ho sui
#
che ho messo attorno a stringa quando definisco sql2
ma soprattutto non capisco se la mia chiamata alla funzione sia corretta,poichè non OTTENGO NIENTE DI NIENTE!!!!!
spero che abbiate un'idea per me
grazie
alomar

Rispondi quotando