trying to create a 'simple' admin page to update mysql dbase

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Aug 2004
Posts: 24
Reputation: ray_broome is an unknown quantity at this point 
Solved Threads: 0
ray_broome ray_broome is offline Offline
Newbie Poster

trying to create a 'simple' admin page to update mysql dbase

 
0
  #1
Dec 5th, 2007
Hi,

I am trying to create a 'simple' admin page where certain (authorized) people can update data in the database or add new info to it. The issue i've run into is after i created the form and have all the fields how do i tell which one(s) the user has typed into/edited so i can use that info in a query.

I was thinking i might need to use the onchange event but not sure how i'd track each field that was changed and then update only those, i even checked some of phpmyadmin's code to see how they do it but couldnt really figure it out.

Help plz
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 1,407
Reputation: ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light 
Solved Threads: 226
Sponsor
ShawnCplus's Avatar
ShawnCplus ShawnCplus is offline Offline
Code Monkey

Re: trying to create a 'simple' admin page to update mysql dbase

 
0
  #2
Dec 5th, 2007
Well that's more of a PHP thing, not so much with JavaScript. You can't do alot(anything?) in Javascript to interact with a database.
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
Reply With Quote Quick reply to this message  
Join Date: Aug 2004
Posts: 24
Reputation: ray_broome is an unknown quantity at this point 
Solved Threads: 0
ray_broome ray_broome is offline Offline
Newbie Poster

Re: trying to create a 'simple' admin page to update mysql dbase

 
0
  #3
Dec 5th, 2007
well the thing is i'm not interacting with the database at this point. The 'fields' i'm referring to are the html form fields where a user would type things such as a name, etc.

e.g. If i had:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. Search for a Plant to update:
  2. Scientific Name _____
  3. Common Name _____
  4. [Search]

How do i tell which field the user has typed in here (sci name/com name or both) so that i can pass that text into a query later on.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 1,407
Reputation: ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light ShawnCplus is a glorious beacon of light 
Solved Threads: 226
Sponsor
ShawnCplus's Avatar
ShawnCplus ShawnCplus is offline Offline
Code Monkey

Re: trying to create a 'simple' admin page to update mysql dbase

 
0
  #4
Dec 5th, 2007
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. var blah = document.getElementById(<textbox id>);
  2. if(blah.value == "")
  3. alert("blah is empty");
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,760
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 332
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: trying to create a 'simple' admin page to update mysql dbase

 
0
  #5
Dec 6th, 2007
You can just validate it through javascript(Or to check if that field has some value or not.) But, Its much easier if you do it in php. eg.
  1. if(isset($_POST['sci_name'])){
  2. echo "Scientific name is ". $_POST['sci_name'];
  3. }
  4. if(isset($_POST['name'])){
  5. echo "General name is ". $_POST['name'];
  6. }
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC