我有一个使用PHP,MySQL和phpMyAdmin的现有数据库.
当用户成为我网站上的会员时,我需要系统使用五位数字为他们创建唯一的会员编号.例如83773.我想这就像生成一个随机密码,除了我只想为我的成员编号.此ID号必须是每个成员唯一的.
我可以在我的用户表中将主键设置为auto_increment并将其设置为从10000开始,然后每次成员注册时自动递增吗?
此外,是否存在主键ID号最多可达的最大数量?
这是使用主键ID号作为会员号码的可靠且安全的方法吗?
我在coldfusion中输入一个简单的循环代码.但为什么它不能显示结果.它打印出里面的所有东西....
这是我的代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test Loop</title>
</head>
<body>
<cfscript>
i=0;
for(i; i < 10; i++){
WriteOutput("Current Position: #i# <br />") ;
}
</cfscript>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
结果打印为:
i = 0; for(i = 1; i LTE 10; i = i + 1){WriteOutput("当前位置:#i#"); }
我是新来的.我创建一个表,可以显示数据库中的数据,并创建另外一个表来显示所选的数据.但问题是如果我们只选择一些数据就不会有问题.但如果选择超过100个数据,则可能导致布局问题.
这是我的代码......
<script type="text/javascript">
function List(){
var selectedProduct = "";
var product = document.getElementById('product');
var output ="";
var k = 0;
var name = new Array;
var model = new Array;
var unitprice = new Array;
<?php foreach ($productPrices as $price): ?>
name[k] = "<?php echo $price['Product']['txtname']; ?>";
model[k] = "<?php echo $price['Product']['txtmodel']; ?>";
k++;
<?php endforeach; ?>
k=0;
for (var i = 0; i < product.length; i++) {
k = product.options[i].value;
if (product.options[i].selected) {
output += '<tr>'+
'<td style="border-right: …Run Code Online (Sandbox Code Playgroud)