Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

making an image database and displaying it 1

Status
Not open for further replies.

rninja

Technical User
Joined
Apr 11, 2001
Messages
381
Location
US
How do you create a simple database without any php or programming language, only SQL? For instance:
I want to create a database for joes autos. I want the table like so:
year | make | model | color | price | picture

The picture would actually hold an image of the car.
If someone can also provide a simple coldfusion app to access this table, that would be awesome. Rninja

smlogo.gif

 
the SQL syntax for creating database tables:

CREATE TABLE "tableName" ("field1" "data type"[constraint], "field2" "data type"[constraint]);

You may have as many fields as you like and constraints are optional.

your case example:

CREATE TABLE classdata
(year number(4) not null,
make varchar(50) not null,
model varchar(50) not null,
color varchar(25),
price number(25),
picture varchar(25) not null)



to access that table info you will use cfquery tag:

<cfquery name=&quot;getCarInfo&quot; datasource=&quot;databaseName&quot; dbtype=&quot;ODBC&quot;>
SELECT *
FROM classdata;
</cfquery>

to output the info you can use cfoutput tag:


<cfoutput query=&quot;getCarInfo&quot;>
#year# #make# #model# #price#<br>
<img src=&quot;images/#picture#&quot; border=&quot;0&quot; alt=&quot;&quot;>
</cfoutput> Sylvano
dsylvano@hotmail.com

&quot;every and each day when I learn something new is a small victory...&quot;
 
Thanks! that worked great! I just wanted to ask one more thing. Would you happen to also know how to make an upload form that would enter this info into the mysql database? including the image?

Thanks in advance! Rninja

smlogo.gif

 
this is my site:


check out the submission section (you'll see two different forms - submitting graphic or wav files); the code will check files, create thumbnails if necessary, and store the info in the given database;
if you think you can use that concept, let me know and I'll give you the code, k? Sylvano
dsylvano@hotmail.com

&quot;every and each day when I learn something new is a small victory...&quot;
 
I cannot get you page to work out. You've got some CF errors occuring upon signup and when I look through the library...
Let me know when to check back... Thanks! Rninja

smlogo.gif

 
ok, help me out here. I am trying to generate error but everything works fine; can you copy the error message you are getting and post it here or email it to me?

thx Sylvano
dsylvano@hotmail.com

&quot;every and each day when I learn something new is a small victory...&quot;
 
OK. this one came from the new user form:
Error Occurred While Processing Request
Error Diagnostic Information
Error processing CFFILE

Unable to move file 'C:\Inetpub\ to path 'C:\Inetpub\ The system cannot find the file specified. (error 2)

The error occurred while processing an element with a general identifier of (CFFILE), occupying document position (98:4) to (100:64) in the template file C:\INETPUB\

Date/Time: 09/26/01 15:36:16
Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)
Remote Address: 201.102.82.11
HTTP Referer: Query String: register=true




This error occured when I tried accessing the banner submission in the library:

Error Occurred While Processing Request
Error Diagnostic Information

An error occurred while evaluating the expression:


endRow = startRow + onEachPage - 1



Error near line 159, column 7.
--------------------------------------------------------------------------------

Cannot convert to number.

Please, check the ColdFusion manual for the allowed conversions between data types


The error occurred while processing an element with a general identifier of (CFSET), occupying document position (159:1) to (159:42) in the template file C:\INETPUB\

Date/Time: 09/26/01 15:37:55
Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)
Remote Address: 151.202.107.66
HTTP Referer: Query String: action=webGraphic&mainCategory=banner




Hope this helps!

Rninja

smlogo.gif

 
Thank you for your post. I believe that i have corrected the problem. Check out that form, let me know if you want it. You have earn it now... Sylvano
dsylvano@hotmail.com

&quot;every and each day when I learn something new is a small victory...&quot;
 
You definately fixed the form, but I still have problems accessing the libraries. Here is the error I get regardless of the section:

Error Diagnostic Information

An error occurred while evaluating the expression:


endRow = startRow + onEachPage - 1



Error near line 159, column 7.
--------------------------------------------------------------------------------

Cannot convert to number.

Please, check the ColdFusion manual for the allowed conversions between data types


The error occurred while processing an element with a general identifier of (CFSET), occupying document position (159:1) to (159:42) in the template file C:\INETPUB\

Date/Time: 09/26/01 16:44:52
Browser: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98)
Remote Address: 151.202.107.66
HTTP Referer: Query String: action=webGraphic&mainCategory=threeDee

Rninja

smlogo.gif

 
you know, if this is not my site, I would say: hmmm, this is an interesting problem we have here, but this I tend to take personaly;
I am testing and retesting, I have a friend that is abusing the site from another computer and on another location and we can not generate the error you are getting;

can you please try and do it again and then tell me how you did it?

Sylvano
dsylvano@hotmail.com

&quot;every and each day when I learn something new is a small victory...&quot;
 
Actually, It seems to be working now. One new issue....
I upload a graphic and then I go to the section to look for my graphic, but it is not there. I uploaded a ribbon.gif/jpg to the banners directory, but when I go there I saw no entry for the ribbon.

Let me know If I missed something, but that is the type of script I would like you to help me out with. I need a script just like that, but without all the complexity...

Thanks! Rninja

smlogo.gif

 
i have found the ribbon you have uploaded - it's in the backgrounds(miscelaneous) files; as for the form, i'll email the info where you can download it

thanks Sylvano
dsylvano@hotmail.com

&quot;every and each day when I learn something new is a small victory...&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top