Hi Everyone...I am a super newbie here so please keep that in mind and don't laugh at me...and please explain things ultimate simple.

I am taking a basic course on web designing (not developing, so I bow to you all). In my latest project I have a report.html form that populates through a report.php to a table I created on a shared database created at the college for our projects.

The creating all worked fine until I realized I'd missed a column in my table. So...I tried to use an Alter Table code which would echo "Success, column created" so I'd know I did it right. Only it returned nothing. A blank so...I don't know that I did it right...and instinct says I did it wrong.

What I need to know is the exact php script to insert into my report.php (temporarily) just to create that column and what my code should be in my report.html to enable the report.php.

Guys, I know there are way more sophisticated ways to do all this but please, I am an uber newbie and just need simple, basic and easy steps. :o

    if you have access to something like phpmyadmin, or anther interface it would easier.

      Yes, but that wasn't my question and it didn't really help with my given situation. 🙁

      For phpMyAdmin how do I ascertain the document root of my subdomain? Easily. I don't have a problem locally but with the college establishing a virtual host...I am confused.

        5 days later

        How are you currently running the PHP? I presume through a browser? Chcuk a copy of phpMyAdmin in there if you really don't have access to an installed copy.

        Failing that, the MySQL code for altering a table and adding column would be something like this (depending on exactly what you wanted the new field to be, etc)

        ALTER TABLE table_name ADD field_name VARCHAR( 50 ) NOT NULL ;

        Obviously, it will depend on what the new field is to contain, and act. I'd recommend getting a book on MySQL if you plan on doing this sort of thing a lot in the future.

          Write a Reply...