php和 mysql 应用相关

php中文网
发布: 2016-06-06 09:43:36
原创
1156人浏览过

mysqlphp

// this script retrieves all the records from the users table.

$page_title = 'View the Current Users';
include ('includes/header.html');

// Page header:
echo '

Registered Users

';

require ('./mysqli_connect.php'); // Connect to the db.

// Make the query:
$q = "SELECT CONCAT(last_name, ', ', first_name) AS name, DATE_FORMAT(registration_data, '%M %d, %Y') AS dr FROM users ORDER BY registration_data ASC";

$r = @mysqli_query ($dbc, $q); // Run the query.

立即学习PHP免费学习笔记(深入)”;

if ($r) { // If it ran OK, display the records.

// Table header.echo '<table align="center" cellspacing="3" cellpadding="3" width="75%"><tr><td align="left"><b>Name</b></td><td align="left"><b>Date Registered</b></td></tr>';// Fetch and print all the records:while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)) {    echo '<tr><td align="left">' . $row['name'] . '</td><td align="left">' . $row['dr'] . '</td></tr>';}echo '</table>'; // Close the table.mysqli_free_result ($r); // Free up the resources.  
登录后复制

} else { // If it did not run OK.

// Public message:echo '<p class="error">The current users could not be retrieved. We apologize for any inconvenience.</p>';// Debugging message:echo '<p>' . mysqli_error($dbc) . '<br /><br />Query: ' . $q . '</p>
                    <div class="aritcle_card">
                        <a class="aritcle_card_img" href="/xiazai/code/11223">
                            <img src="https://img.php.cn/upload/webcode/000/000/011/176538061286079.jpg" alt="magento(麦进斗)">
                        </a>
                        <div class="aritcle_card_info">
                            <a href="/xiazai/code/11223">magento(麦进斗)</a>
                            <p>Magento是一套专业开源的PHP电子商务系统。Magento设计得非常灵活,具有模块化架构体系和丰富的功能。易于与第三方应用系统无缝集成。Magento开源网店系统的特点主要分以下几大类,网站管理促销和工具国际化支持SEO搜索引擎优化结账方式运输快递支付方式客户服务用户帐户目录管理目录浏览产品展示分析和报表Magento 1.6 主要包含以下新特性:&bull;持久性购物 - 为不同的</p>
                            <div class="">
                                <img src="/static/images/card_xiazai.png" alt="magento(麦进斗)">
                                <span>0</span>
                            </div>
                        </div>
                        <a href="/xiazai/code/11223" class="aritcle_card_btn">
                            <span>查看详情</span>
                            <img src="/static/images/cardxiayige-3.png" alt="magento(麦进斗)">
                        </a>
                    </div>
                ';
登录后复制

} // End of if ($r) IF.

mysqli_close($dbc); // Close the database connection.

include ('includes/footer.html');
?>

larry Ullman(php 和MySQL)的书上的,调了2小时,都没搞明白,连接不上数据库啊,万能的CSDN 救救我吧;



View the Current Users






Your Website


catchy slogan...





  • Home Page

  • Register

  • View Users

  • Change Password

  • link five




Registered Users


上面的HTML 就是运行文件结果,php里关于数据库相关代码全被略掉了;
PHP速学教程(入门到精通)
PHP速学教程(入门到精通)

PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号