Php > Database Related
PHP & MySQL Tagboard
PHP & MySQL Tagboard HTML for tagboard:
--post.php-- here."; ?> --view.php-- $row[name]: $row[msg]
"; } ?> --admin.php--
View messages
Delete all messages
"; if($action == "view"){ connect(); $query = "SELECT id,name,http,msg FROM tagboard ORDER BY id DESC"; $result = mysql_query($query); while ($rows = mysql_fetch_row($result)){ echo "
$row[name]
: $row[msg] :
Delete
"; } } if($action == "del"){ connect(); $query = "DELETE FROM tagboard WHERE id='$id'"; $result = mysql_query($query); } if($action == "delall"){ connect(); $query = "DELETE FROM tagboard"; $result = mysql_query($query); } if($action == "update"){ connect(); $query = "SELECT id,name,http,msg FROM tagboard ORDER BY id DESC"; $result = mysql_query($query); while ($rows = mysql_fetch_row($result)){ echo "
$row[name]
: $row[msg] : ID#: $row[id]
"; } echo "
Message
"; } if($go == "yes"){ connect(); $id = stripslashes($id); $id = htmlspecialchars($id); $name = stripslashes($name); $name = htmlspecialchars($name); $http = stripslashes($http); $http = htmlspecialchars($http); $msg = stripslashes($msg); $msg = htmlspecialchars($msg); $query = "UPDATE tagbard WHERE id='$id' SET name='$name' http='$http' msg='$msg'"; $result = mysql_query($query); echo "ID # $id has been edited successfully."; } } ?> --sql syntax-- CREATE TABLE tagboard (id TINYINT (4) not null AUTO_INCREMENT, name VARCHAR (32), msg VARCHAR (50), http VARCHAR (32) , PRIMARY KEY (id))
Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage