Closed Thread Icon

Topic awaiting preservation: Dreamweaver CS3 + Database + Help Pages that link to <a href="https://ozoneasylum.com/backlink?for=29715" title="Pages that link to Topic awaiting preservation: Dreamweaver CS3 + Database + Help" rel="nofollow" >Topic awaiting preservation: Dreamweaver CS3 + Database + Help\

 
Author Thread
axleclarkeuk
Paranoid (IV) Inmate

From: Swansea, Wales, UK
Insane since: Aug 2001

posted posted 11-25-2007 23:24

Hi Folks,
I will try to explain this as best i can and i hope that someone can point me in the right direction.

I am new to databases and have recently learned how to setup an SQL database that i am able to send data to and from using a web page.

Heres my problem.

I have a series of pages (each one laid out the same, but the heading will be different) but i want to be able to use the same admin page to update a specific page only depending on which page i select from a dropdown list.

So, in the admin page for example i have a dropdown with a couple of options (contracts). I select a contract from that list, enter the rest of my data in the fields and when i press SUBMIT, i want it to be able to update the corresponding page only. Am i making sense ?

i am totally new to this and dont have any real background experience so an help would be great, if only to point me in the right direction.

Thanks in advance for anyone offering advice.

No Sig ?

zavaboy
Paranoid (IV) Inmate

From: f(x)
Insane since: Jun 2004

posted posted 11-25-2007 23:51

If the values of that dropdown equal the unique IDs within the database, you can use a query like this:

code:
UPDATE `table` SET `col1`='val1',`col2`='val2'... WHERE `id`=[the value what you selected in the dropdown] LIMIT 1


In PHP it would look like this:

code:
$query = 'UPDATE `table` SET `col1`=\'val1\',`col2`=\'val2\'... WHERE `id`='.$_POST['contract'].' LIMIT 1';


If this doesn't help, please explain more.



(Edited by zavaboy on 11-25-2007 23:51)

axleclarkeuk
Paranoid (IV) Inmate

From: Swansea, Wales, UK
Insane since: Aug 2001

posted posted 11-26-2007 01:48

Thats great. I am sure that correct as it was mentinoed by someone that i will need to be using UPDATE. just need to figure out what i am to do with it.

Thanks Zav, very much appreciated.

No Sig ?

zavaboy
Paranoid (IV) Inmate

From: f(x)
Insane since: Jun 2004

posted posted 11-26-2007 06:01

This may help in your journey:
http://google.com/search?q=dreamweaver+database+tutorial

axleclarkeuk
Paranoid (IV) Inmate

From: Swansea, Wales, UK
Insane since: Aug 2001

posted posted 11-27-2007 01:44

Thanks for the link Zav, however i beat you to it, lol. Still all greek to me, but i'm enjoying myself all the same

No Sig ?

« BackwardsOnwards »

Show Forum Drop Down Menu