A business card library program using php+mysql_PHP tutorial
Use php+mysql to create a business card library program with classification search and paging functions.
Step 1: Make a static page first according to the following representation.
第二步:如下建库。
id int(4) 否 auto_increment
http varchar(25) 否
name varchar(50) 否
email varchar(50) 否
gs varchar(200) 否
address varchar(200) 否
yb varchar(20) 否
zw varchar(100) 否
tel varchar(20) 否
fax varchar(20) 否
bp varchar(20) 否
第三步:查找执行程序
if (!isset($show)) $show=0;
{
if($query1=="查找")
{
$db=mysql_connect("localhost","用户名","密码");
$dbname=mysql_select_db("库文件名",$db);
mysql_query('select * from 表文件名',$db);
$limit=2; //一页显示几条内容。
//global $query,$queryyy,$quer;
switch($inout)
{
case "N":
//按姓名查找
$query="select * from card where name like '%$keyword%'";
$queryyy = "select * from card where name like '%$keyword%' order by id desc limit $show, $limit";
break;
case "C":
//按地区查找
$query="select * from card where address like '%$keyword%' order by id desc";
$queryyy = "select * from card where address like '%$keyword%' order by id desc limit $show, $limit";
break;
case "A":
// 按职务查找
$query="select * from card where zw like '%$keyword%' order by id desc";
$queryyy = "select * from card where zw like '%$keyword%' order by id desc limit $show, $limit";
break;
}
$result1=mysql_query($query);
$total=mysql_num_rows($result1); //总的符合条件的记录数
$quer=mysql_query($queryyy,$db);
$pages=ceil($total/$limit);
}
}
?>
你查找的关键字是:: echo $keyword;?>
echo "
查找名片如下: 共有["; echo $total; echo "]张名片 | 共分["; echo $pages; echo "]页 |
while ($row = mysql_fetch_array($quer))
{
echo "
|
";
}
$vor = $show + $limit;
$back = $show - $limit;
print "
print "
"; for ($i=1;$i<=$pages;$i++) { $new_offset=$limit*($i-1); $parameter="query1=$query1&keyword=$keyword&inout=$inout"; print " $i$nbsp"; } print " | "; //显示上一页 if ($show - $limit >= 0) { print " 上一页"; } print " | "; //显示下一页 if (($show + $limit) < $total) { print "下一页 "; } print " | "; //Show all comments //print "All business cards "; print " |
print "
?>
If you have any questions, please mailto:lyjrich@sina.com. There is a problem with this program. If you want to display all business cards, my program has not implemented this function. If you know how to display it in this program, If you have all the business cards, I hope you can send them to me via email.
[The copyright of this article is jointly owned by the author and Oso.com. If you need to reprint, please indicate the author and source]

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The default map on the iPhone is Maps, Apple's proprietary geolocation provider. Although the map is getting better, it doesn't work well outside the United States. It has nothing to offer compared to Google Maps. In this article, we discuss the feasible steps to use Google Maps to become the default map on your iPhone. How to Make Google Maps the Default Map in iPhone Setting Google Maps as the default map app on your phone is easier than you think. Follow the steps below – Prerequisite steps – You must have Gmail installed on your phone. Step 1 – Open the AppStore. Step 2 – Search for “Gmail”. Step 3 – Click next to Gmail app

Both vivox100s and x100 mobile phones are representative models in vivo's mobile phone product line. They respectively represent vivo's high-end technology level in different time periods. Therefore, the two mobile phones have certain differences in design, performance and functions. This article will conduct a detailed comparison between these two mobile phones in terms of performance comparison and function analysis to help consumers better choose the mobile phone that suits them. First, let’s look at the performance comparison between vivox100s and x100. vivox100s is equipped with the latest

Is the clock app missing from your phone? The date and time will still appear on your iPhone's status bar. However, without the Clock app, you won’t be able to use world clock, stopwatch, alarm clock, and many other features. Therefore, fixing missing clock app should be at the top of your to-do list. These solutions can help you resolve this issue. Fix 1 – Place the Clock App If you mistakenly removed the Clock app from your home screen, you can put the Clock app back in its place. Step 1 – Unlock your iPhone and start swiping to the left until you reach the App Library page. Step 2 – Next, search for “clock” in the search box. Step 3 – When you see “Clock” below in the search results, press and hold it and

Are you getting "Unable to allow access to camera and microphone" when trying to use the app? Typically, you grant camera and microphone permissions to specific people on a need-to-provide basis. However, if you deny permission, the camera and microphone will not work and will display this error message instead. Solving this problem is very basic and you can do it in a minute or two. Fix 1 – Provide Camera, Microphone Permissions You can provide the necessary camera and microphone permissions directly in settings. Step 1 – Go to the Settings tab. Step 2 – Open the Privacy & Security panel. Step 3 – Turn on the “Camera” permission there. Step 4 – Inside, you will find a list of apps that have requested permission for your phone’s camera. Step 5 – Open the “Camera” of the specified app

With the rapid development of the Internet, the concept of self-media has become deeply rooted in people's hearts. So, what exactly is self-media? What are its main features and functions? Next, we will explore these issues one by one. 1. What exactly is self-media? We-media, as the name suggests, means you are the media. It refers to an information carrier through which individuals or teams can independently create, edit, publish and disseminate content through the Internet platform. Different from traditional media, such as newspapers, television, radio, etc., self-media is more interactive and personalized, allowing everyone to become a producer and disseminator of information. 2. What are the main features and functions of self-media? 1. Low threshold: The rise of self-media has lowered the threshold for entering the media industry. Cumbersome equipment and professional teams are no longer needed.

As Xiaohongshu becomes popular among young people, more and more people are beginning to use this platform to share various aspects of their experiences and life insights. How to effectively manage multiple Xiaohongshu accounts has become a key issue. In this article, we will discuss some of the features of Xiaohongshu account management software and explore how to better manage your Xiaohongshu account. As social media grows, many people find themselves needing to manage multiple social accounts. This is also a challenge for Xiaohongshu users. Some Xiaohongshu account management software can help users manage multiple accounts more easily, including automatic content publishing, scheduled publishing, data analysis and other functions. Through these tools, users can manage their accounts more efficiently and increase their account exposure and attention. In addition, Xiaohongshu account management software has

PHP Tips: Quickly implement the function of returning to the previous page. In web development, we often encounter the need to implement the function of returning to the previous page. Such operations can improve the user experience and make it easier for users to navigate between web pages. In PHP, we can achieve this function through some simple code. This article will introduce how to quickly implement the function of returning to the previous page and provide specific PHP code examples. In PHP, we can use $_SERVER['HTTP_REFERER'] to get the URL of the previous page
![Scripted diagnostics native host has stopped working [FIXED]](https://img.php.cn/upload/article/000/465/014/171012105385034.jpg?x-oss-process=image/resize,m_fill,h_207,w_330)
When running a program or troubleshooting, if you get an error message indicating that script diagnostics localhost has stopped working, this could be due to a number of reasons. Fixing this issue on a Windows 11/10 PC may require a different approach, as each computer's situation may be different. One common reason is that the script itself is buggy or corrupted, preventing it from running properly. Solutions to this problem may include repairing or reinstalling the script, or trying a different version of the script. Another possible cause is corrupted or missing system files, which may affect the script's operation. In this case, you can try running a system file check tool to repair any damaged files, or perform a system recovery to restore to the previous
