PHP3 Introduction Introduction to PHP and web database interfacing with MySQL. PHP3 is an HTML-embedded scripting language allowing web developers to create dynamic, database-driven websites.
Name:
Vinnie
Subject:
Any current dynamic table update scripts available?
Date:
01-27-2000 02:47PM
I have put together a code using functions to:
1) Authenticate user based on the user table in mysql
2) Take the authenticated user to a display of a certain table, that I have formatted in HTML.
Now what i'm trying to do is:
1) In the same step #2, give the user the option to delete or modify a row. But i have formatted the mysql row in HTML format to be as such:
Example of SQL row #1 in table "em_table"
customer, router_login, router_password, switch_login, switch_password
How i have formatted it to display the "em_table" in an HTML form:
How can i offer the user a "button" that is besides each row that lets the user "delete" that specific row?
Also, Now a bit more complicated, is how can i offer the user to "modify" a row? When he/she clicks on this "modify" button, he/she will be taken to another php3 form, where the form above will appear just as it is, but instead the "$" fields can be modified and having the original values as the standard "em_table row1" values?
The code i'm using for adding an entry is below. That's the only code i have, and it still doesnt work(doesnt seem to pass the data to the database). I appreciate for any help guys...
Vinnie
function addData() {
global $mysqlHandle, $dbname, $tablename, $PHP_SELF;
echo "
Add a new entry
";
}
function addData_submit () {
global $mysqlHandle, $dbname, $tablename, $fieldname, $PHP_SELF;
mysql_select_db( mysql, $mysqlHandle );
$query = "INSERT INTO em_table VALUES ('$id','$customer','$router_login','$router_
priv_password')";
print $query;
$result = mysql_db_query("mysql",$query);
listDatabases( "" );
}
*Where listDatabases is another function to display the em_table, and it does work*