Replacing info in table/database...
Posted: Thu May 15, 2008 8:43 pm
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.
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!
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);
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!