Replacing info in table/database...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Doppler2004
Forum Newbie
Posts: 1
Joined: Thu May 15, 2008 8:30 pm

Replacing info in table/database...

Post by Doppler2004 »

I want to replace data in a table/database using PHP. I've used phpMyAdmin to view my MySQL database and everything I go to replace data in the database via html form I, it just shows the list of what I entered under "Optimal_fieldtype"

It looks something like this...ENUM('22','Band','band concert','banssss','Hello',...) under my "Optimal_fieldtype".

Now, I want to just replace that data within that table cell, not have all of this left behind? Or is this normal?

This is part of the php code I am using to insert the data.

Code: Select all

 
$query = "INSERT INTO events VALUES ('','$mon10a','$mon11a')";
mysql_query($query);
 
But if I want to change say variable '$mon10a', and I run the html form again, it does make the change and work, but it adds the previous value to the 'Optimal_fieldtype'. So, again, is there a way to just flat out replace it? And if not, is this normal and does those values under the 'Optimal_fieldtype' take up space out of my MySQL database.

On a side note, is this same thing possible to do with just an XML file? Or what would be more reasonable?

I'm somewhat new to PHP and trying to pick it up, so any help is much appreciated.

Thanks!
nowaydown1
Forum Contributor
Posts: 169
Joined: Sun Apr 27, 2008 1:22 am

Re: Replacing info in table/database...

Post by nowaydown1 »

I'm not sure I really understand what all is going on. It sounds like you have a column on some database table called Optimal_fieldtype that has a datatype of enum. Could you try explaining your problem in a different way? Is it that it's inserting too many rows in your events table or something different? Didn't quite follow :)
Post Reply