Regards
Mark Henderson
Web Designer
mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
205 Main Street
PO Box 143, Gore
Southland 9700
Phone: (03) 203 9999
Fax: (03) 203 9900
-----Original Message-----
From: Mark Henderson
Sent: Monday, August 16, 2004 11:57 AM
To: CF-Talk
Subject: Query Manipulation Error in UNION
I am trying to create a random image that will allow for the selection of JPGs and GIF files....coee is as follows..
<!--- retrieve all JPGs --->
<cfdirectory name="getJPG"
action=""> directory="#serverdir#"
filter="*.jpg" >
<!--- retrieve all GIFs --->
<cfdirectory name="getGIF"
action=""
directory="#serverdir#"
filter="*.gif" >
<!--- join the queries with a UNION in a QoQ
cfdirectory automatically returns directory name as "Name") --->
<cfquery dbtype="query" name="images">
SELECT * FROM getJPG
UNION
SELECT * FROM getGIF
ORDER BY Name
</cfquery>
<!--- This variable is a comma delimited list of all images found in the directory --->
<cfparam name="imglist" default="">
<cfloop query="images">
<cfset imglist = listappend(imglist, name, ",")>
</cfloop>
<!--- "ThisImage" is this rounds random image file --->
<cfset thisimage = listgetat(imglist, randrange(1, listlen(imglist)))>
<cfoutput>
<img src=""> </cfoutput>
THis works on my MX server at home, but at work where we are running vesion 5.0 I receive the following.....
<snipped>
Query Manipulation Error Code = 0
Tables not union compatible. Different datatypes.
</snipped>
error.
Any ideas??
TIA
Regards
Mark Henderson
Web Designer
mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
205 Main Street
PO Box 143, Gore
Southland 9700
Phone: (03) 203 9999
Fax: (03) 203 9900
-----Original Message-----
From: Ewok [mailto:[EMAIL PROTECTED]
Sent: Monday, August 16, 2004 11:32 AM
To: CF-Talk
Subject: Re: Fiel Field style : )
nope... i added this.imagefield1.disabled=false; in the <form> tag
extremely weird.... you have to click the upload button twice and the first click clears the imagefield1 field then end up with the same CF error
i tried adding then i get a JS error saying "Access denied" booooo
this is what it is now....
<cfif isdefined('form.upload')>
<cffile action="" filefield="imagefield1" destination="#request.imagepath#\cache" nameconflict="makeunique">
</cfif>
<cfoutput>
<form name="imageform" action="" method="post" enctype="multipart/form-data" > <input type="file" name="imagefield1" style="display: none;">
<input type="text" name="imagefield2" size="30">
<input type="button" class="formbutton" value="Browse..."><br>
<input type="submit" name="upload" class="formbutton" value="Upload Image">
</form>
</cfoutput>
----- Original Message -----
From: S. Isaac Dealey
To: CF-Talk
Sent: Sunday, August 15, 2004 7:03 PM
Subject: Re: Fiel Field style : )
put this in your form: = false;"
> I have been trying to figure out forever how to change the
> style on the Browse button of a file field and have
> finally got it.... but using the code below Coldfusion
> returns an error saying:
> The form field "imagefield1" did not contain a file.
> same thing from imagefield2 of course... its not a file
> field
> if you take the style off of imagefield1 you can see that
> the same text is in there that is in the imagefield2 field
> <cfif isdefined('form.upload')>
> <cffile action="" filefield="imagefield1"
> destination="#request.imagepath#\cache"
> nameconflict="makeunique">
> </cfif>
> <cfoutput>
> <form name="imageform" action=""> > ex.cfm?adminaction=images&imgaction=add&imgsect=#url.imgse
> ct#" method="post" enctype="multipart/form-data">
> <input type="file" name="imagefield1" style="display:
> none;">
> <input type="text" name="imagefield2" size="30">
> <input type="button" class="formbutton" > > ield1.disabled=false;imagefield1.click();imagefield2.va
> lue=imagefield1.value;imagefield1.disabled=true;"
> value="Browse..."><br>
> <input type="submit" name="upload" class="formbutton"
> value="Upload Image">
> </form>
> </cfoutput>
> any thoughts? or is it just another failed attempt at
> trying to change the look of that damned "Browse" button
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

