PHP and MySQL Problem solving solution

Source: Internet
Author: User
Tags php and mysql
PHP and MySQL problems
As shown


To add the ability to delete the user account password in this mysql_result.php Web page, change him to the following image so that he can click [Delete]
This hyperlink, you can erase the value of that line.




Please ask what you want to do??

The following is the source code for mysql_result.php



<title>Show All Records</title>


Account Password Display table


Require_once ("mysql.php");
$link = Create_connection ();
$sql = "Select No as ' number ', username as ' account ', password as ' password ' from root ';
$result = Execute_sql ("OS", $sql, $link);
echo "












"; for ($i = 0; $i < Mysql_num_fields ($result); $i + +) echo " "; echo " "; for ($j = 0; $j < mysql_num_rows ($result); $j + +) {echo " "; for ($k = 0; $k < Mysql_num_fields ($result); $k + +) echo " "; echo " "; } echo "
" . Mysql_fetch_field ($result, $i)->name. "
" . Mysql_result ($result, $j, $k). "
" ;
Mysql_free_result ($result);
Mysql_close ($link);
?>




And then there's the source code for this necessary file, mysql.php.

function Create_connection ()
{
$link = mysql_connect ("localhost", "root", "")
Or Die ("Unable to connect". Mysql_error ());

mysql_query ("SET NAMES UTF8");

return $link;
}
function Execute_sql ($database, $sql, $link)
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.