aight, i had a friend make this for me, but i want it in seperate files not all in one, i want staff.php to view the table, substaff.php to submit them and config.php for the configuration the code he gave me for 1 file is all fo them combined is:
PHP Code:
$db_user '*****';
$db_pass '**********';
$db_database '*******';
$db_table '*****';

mysql_connect$db_host$db_user$db_pass );
mysql_select_db$db_database );
switch (
$result mysql_query("SELECT * FROM $db_table");
        <div id="goback"><a href="javascript:history.go(-1);">Back</a></div>
        <table class="data_table" border="1">
<?php    while ($row mysql_fetch_array$result )) :    ?>
        <tr>    <td> <?php echo htmlspecialchars$row['name'] ); ?> </td>
                <td> <?php echo htmlspecialchars$row['email'] ); ?></td>
                <td> <?php echo htmlspecialchars$row['job'] ); ?>  </td>        </tr>
<?php    endwhile;        
        if (
$_POST['submit']) {
$name     mysql_real_escape_string$_POST['name'] );
$email     mysql_real_escape_string$_POST['email'] );
$job     mysql_real_escape_string$_POST['job'] );
            if ( 
mysql_query("INSERT INTO $db_table (`name`, `email`, `job`)".
"VALUES ('$name', '$email', '$job')") ) {
                <div id="success">Info added successfully!</div>
<?php        }  else {?>
                <div id="error"> ERROR!!!!!!!!</div>
<?php        }        
            <a href="?act=view" id="view"> View Table </a>

            <h2> Data Submission </h2>
            <form action="" method="post">

            <div id="Name">      Name:    <input type="text" name="name" value="" />             </div>
            <div id="Email">     Email:    <input type="text" name="email" value="" />         </div>
            <div id="Job">         Job:    <input type="text" name="job" value="" />             </div>
            <div id="submit">     <input type="submit" name="submit" value="Submit" /></div>


thats all i got, it works fine with that one, but i wana sue it in diff parts of site like substaff.php in background so i can edit the staff, staff.php in front end of site for ppl to view and config where needed