mysqlphp
// this script retrieves all the records from the users table.
$page_title = 'View the Current Users';
include ('includes/header.html');
// Page header:
echo '
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 主要包含以下新特性:•持久性购物 - 为不同的</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 救救我吧;
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号