开发者

Building a simple CMS to manage mysql? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 10 years ago.

I want to build a simple CMS system that would be directly connected to my remote databa开发者_如何学JAVAse (mysql) and be able to add,delete/update fields/records.

Are there any examples of this, tutorials? where should I start?

I'm assuming the language would be php? (Are there any free scripts that does this already?). I would like to build my own regardless.


Use adminer or phpMyAdmin

You don't need to make your own. They are both opensource so you can go through it and browser around code

Easy example code (show tables & allow to delete tables)

<?php
if ($_GET['del']){
    mysql_query("DROP TABLE ".$_GET['del']);
    echo "done";
}

if ($_POST['password']){
    $con = mysql_connect('localhost', $_POST['username'], $_POST['password']) or die("Wrong details");
    mysql_select_db($_POST['db']) or die("Wrong database");
}


if ($con){
    $result = mysql_query("SHOW TABLES");
    while($row = mysql_fetch_row($result)){
        echo "<br/>Table ".$row[0]." (<a href='?del=".$row[0]."'>Delete</a>)";
    }
    die();
}
?>

<form method="post" action="">
Username: <input name="username" /><br />
Password: <input name="password" /><Br />
Database: <input name="db" /><br />
<input type="submit" />
</form>


You need to make sure you read up on MySQL injection to ensure a undesirable visitor cannot inject malicious queries into your database.

I would recommend PHP as I find it goes hand in hand with MySQL

Take a look at this to get you started: http://phpminiadmin.sourceforge.net/


If you still want to make your own tools for managing MySQL dbs start by making a decision about what language you want to develop these tools with.

.NET/C# combined with WPF can be a great a solution a desktop based one of course but it will do.

Learning is never annoying.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜