Old 20-02-2007, 19:52   #1 (permalink)
mgpwr
with a hint of lemon
 
mgpwr's Avatar
 
Join Date: Aug 2006
Location: Sheffield
Posts: 500
PhP Questions

Hey everyone, i'm testing my new site, and so far so good, all validates and runs smoothly, into these i've also been havin a proper dap at PhP, i've been trying to learn anyways lol, However there to two questions i need answering:

1) How do i get only the last three entries into a database to display, also with the last first, hoowever i am assuming it will still be SELECT * FROM 'example' ORBER BY DESC

2) How would i get a file uploaded, and depending on what checkbox is checked depends were the file is uploaded to!


Cherrs and nite, its 00:51 and i'm knackered!
__________________
Online portfolio: mgpwr.co.uk
  Reply With Quote
Old 20-02-2007, 21:46   #2 (permalink)
SpooF
Registered User
 
SpooF's Avatar
 
Join Date: Feb 2007
Posts: 31
Quote:
Originally Posted by mgpwr
1) How do i get only the last three entries into a database to display, also with the last first, hoowever i am assuming it will still be SELECT * FROM 'example' ORBER BY DESC

SELECT * FROM 'example' ORBER BY DESC LIMIT 3

Quote:
Originally Posted by mgpwr
2) How would i get a file uploaded, and depending on what checkbox is checked depends were the file is uploaded to!

Do you want it to be uploaded to more than one directory? If so then you can use a foreach statement with your check boxs. By making the name variable[] when you grab the variable php will see it as an array. Then you can use the foreach statement.
  Reply With Quote
Old 20-02-2007, 22:24   #3 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,340
Quote:
Originally Posted by SpooF
LIMIT 3
Bearing in mind that's only valid in MySQL, right? Limit isn't found in standard SQL, as I recall.

Preemptive: I know he's using MySQL, but just a warning in case he moves to MSSQL or PostgreSQL sometime.
  Reply With Quote
Old 21-02-2007, 09:04   #4 (permalink)
mgpwr
with a hint of lemon
 
mgpwr's Avatar
 
Join Date: Aug 2006
Location: Sheffield
Posts: 500
No, it will only be going to one place at a time, its so i can start getting a simple CMS for my website, i log in, and when i fil out the portfolio update, i can select what folder the pics go in, i.e a thumbnail in the smallpics flder and the large picture in the ... wait can you guess.. largepicfolder lol...
__________________
Online portfolio: mgpwr.co.uk
  Reply With Quote
Old 21-02-2007, 10:04   #5 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,340
You know, you could just upload one image and use PHP to create a thumbnail. It can manipulate images, you know. Don't ask me how, I haven't gotten to that chapter yet.
  Reply With Quote
Old 21-02-2007, 17:01   #6 (permalink)
SpooF
Registered User
 
SpooF's Avatar
 
Join Date: Feb 2007
Posts: 31
Quote:
Originally Posted by mgpwr
No, it will only be going to one place at a time, its so i can start getting a simple CMS for my website, i log in, and when i fil out the portfolio update, i can select what folder the pics go in, i.e a thumbnail in the smallpics flder and the large picture in the ... wait can you guess.. largepicfolder lol...


Then I would just use a radio button. give the a name such as 'folder' and each one a different value, ie) 0,1,2. Then in your script you can tell it to upload to a certain fold by checking that variable.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8