Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-05-2007, 02:09 AM   PM User | #1
student
Regular Coder

 
student's Avatar
 
Join Date: Jan 2007
Posts: 129
Thanks: 13
Thanked 0 Times in 0 Posts
student is an unknown quantity at this point
please help me solve a problem with editing mysql data

hello,
i have a problem and hope the experts here may help.
i have a directory and it provides the titles and descriptions of the sites included in it. all the data is stored in a mysql database and i use php script to work my directory.

i am able to edit the titles and desciptions through phpmyadmin.
and i also want my visitors to be able to edit these titles and descriptions.

but the problem is i want to approve the editing before it actually updates the data in mysql.

when visitors edit the data, i think there are two possibilities
1) modifications should be emailed to me and after i approve them, it should update the mysql database. i know how to send these modifications to my email box. but dont know how to update mysql database from that email box.

2) modifications should be sent to my admin panel where i may approve them. but the problem is, i dont have an admin panel and dont know how to set up an admin panel.

for example this is my table:

$query = "CREATE TABLE sites (
id int(11) NOT NULL auto_increment,
title varchar(70) default NULL,
description text
)";

please inform me how to make this possible.
if this is a big process, please point me some tutorials.
thank you very much for any reply.
student is offline   Reply With Quote
Old 02-05-2007, 03:20 AM   PM User | #2
guelphdad
Super Moderator


 
guelphdad's Avatar
 
Join Date: Mar 2006
Location: St. Catharines, Ontario Canada
Posts: 2,629
Thanks: 4
Thanked 147 Times in 138 Posts
guelphdad will become famous soon enoughguelphdad will become famous soon enough
add the data to the table as soon as it is submitted. create a column called LIVE or some such. Set it to default at 0. When the rows are entered this value gets automatically set to 0. Until you set it to 1 it doesn't update.

when the form is submitted it will send you an email reminder.
guelphdad is offline   Reply With Quote
Old 02-05-2007, 03:27 AM   PM User | #3
student
Regular Coder

 
student's Avatar
 
Join Date: Jan 2007
Posts: 129
Thanks: 13
Thanked 0 Times in 0 Posts
student is an unknown quantity at this point
hello guelphdad
thank you very much for your reply.
but i am new to php and mysql and i feel it is difficult to implement your instructions.
please elaborate.
or
i think it may be easy to implement it once i can look at some example.
can you please give some example or point me to some example?

thank you very much for this help.
student is offline   Reply With Quote
Old 02-05-2007, 11:40 AM   PM User | #4
StupidRalph
Senior Coder

 
Join Date: Mar 2003
Location: Atlanta
Posts: 1,037
Thanks: 14
Thanked 30 Times in 28 Posts
StupidRalph is on a distinguished road
Shouldn't that look like this??

Code:
CREATE TABLE`sites` (id int(11) NOT NULL auto_increment primary key, title varchar(70) default NULL, description text);
Anyway he's saying add a column named "live".

Code:
alter table `directory`.`sites` ,add column `live` boolean  DEFAULT '0' NOT NULL  after `description`
Have your users enter the data in the database. When they enter their data let the 'live' data take the default value you defined (0). In your PHP code, simply use a conditional statement that decides whether or not to display the updated title title according to the value in your 'live column'. If live is set to 1 show updated text. If its not, then do not. I'm also assuming he was suggesting that when a user submits a form you email yourself a notification.
Then run a update query to set the live column to 1.
__________________
Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.
StupidRalph is offline   Reply With Quote
Old 02-05-2007, 01:18 PM   PM User | #5
guelphdad
Super Moderator


 
guelphdad's Avatar
 
Join Date: Mar 2006
Location: St. Catharines, Ontario Canada
Posts: 2,629
Thanks: 4
Thanked 147 Times in 138 Posts
guelphdad will become famous soon enoughguelphdad will become famous soon enough
Exactly, thanks for clarifying.
guelphdad is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:39 AM.


Advertisement
Log in to turn off these ads.