|登录 |注册

查看: 6058|回复: 40
打印 上一主题 下一主题

懂PHP的都来帮帮我[dropdown的问题](新)

[复制链接]
xbluelover
2011-6-16 09:38 PM
本帖最后由 xbluelover 于 2011-12-14 02:28 PM 编辑

新!
我又遇到问题了

这次我要做dropdown menu
我要捉全部在我database里的category和subcategory的data
放在dropdown的search
可是就是不会出

我的code:

<?php
$selectQuery = "SELECT category, subcategory FROM inventory";
$arrpart = executeSelectQuery($selectQuery);
while ($row=mysql_fetch_array($arrpart)) {

$category=$row["category"];
$subcategory=$row["subcategory"];
$options.="<OPTION VALUE=\"$category\">$category</option>";
$options1.="<OPTION VALUE=\"$subcategory\">$subcategory</option>";
}
?>
        <h1>Search: </h1>
        <h2>Category:</h2>
        <SELECT NAME=category>
        <OPTION VALUE=0>Choose
        <? echo $options?>
        </SELECT>

        <h2>Sub-Category:</h2>
        <SELECT NAME=subcategory>
        <OPTION VALUE=0>Choose
        <? echo $options1?>
        </SELECT>

不对吗?
要不然还有别的方法吗?
救我啊。。。


======================================================================================================================
以下的已解决
$updateQuery = "UPDATE register SET Name = '".$Name."', NRIC = '".$NRIC."', BirthDate = '".$BirthDate."', Gender = '".$Gender."', MailingAddress = '".$MailingAddress."', Phone = '".$Phone."', Fax = '".$Fax."', Email = '".$Email."', MaritalStatus = '".$MaritalStatus."', Occupation = '".$Occupation."', ReferredBy = '".$ReferredBy."', Height = '".$Height."', Weight = '" . $Weight . "', ShoesSize = '".$ShoesSize."' WHERE user_ID = '$user_ID' ";
$updateSuccess = executeUpdateQuery($updateQuery);

if ($updateSuccess) {
    echo 'Edit successful';
========================================================================================================================
我只是个学生,为了学校的project而做的
php的东西也是半桶水
我不明白的可能会问很多
请见谅
leon_lcl
2011-6-16 10:04 PM
回复 1# xbluelover


    random password可以存在user 的table里面,如果要知道谁用random password, 谁已经reset password,可以在user的table里面加个status的field来区别它们。这个是比较简单的方法
无风格D
2011-6-16 10:07 PM
actually你可以让他们自己选择他们要的密码,
然后你可以选择使用权限设置,
这样其实比较方便。=)
Jack1826
2011-6-16 10:09 PM
before you send the random password, you need keep a copy to your database.
when the n-user to verify, need to key in the password and ID ,so you can match the password with your database.
xbluelover
2011-6-16 10:33 PM
回复 2# leon_lcl
database 里有‘password’这个field吗?
就是如果说example,
admin需要把那个付了钱的人的status retrieve 出来
update他
然后create random password 在他的row,
再store进去database?


回复 3# 无风格D
可是supervisor就是要我们给他们random password 再login
xbluelover
2011-6-16 10:33 PM
回复 4# Jack1826


就是说
in the database, i will have 1 more field call "password", but before they make payment, the field wil be empty
but after they have make the payment,
admin will retrieve the person ID and use php to generate a random password and store back into databse?
leon_lcl
2011-6-16 10:58 PM
你的database里面应该有个table是save user的information和id吧?你create random password了就存在那里,过后user login的时候就能match了
syid
2011-6-16 11:05 PM
In the first place, how do you want to build the payment module?
They must login to make payment (Most of the web site does this), right?
If that is the case, they would already have account (username and password), isn't?

By right, usershould be able to register and login to make payment by themselves.
Difference is after making payment, the course booking module will be emabled (can be accessed by user).
xbluelover
2011-6-16 11:07 PM
回复 7# leon_lcl

好的我大概抓到了~
现在就是coding部分了~
谢谢哦

我能再问一个吗?
比如说admin能edit user的information
我retrieve user 的information 出来后
edit它~是save and update 回去original 我retrieve的地方对吧
如果我save进去另一个table就等于是duplicate 了是吗?

拍鞋~我coding没有很好,所以问题多多
xbluelover
2011-6-16 11:14 PM
回复 8# syid

But the requirement is,
we can ignore the payment mode, coz they choose to use manual payment (weird right)
so after the payment manually, admin needs to generate random password in order for the customer to login and view the course.
您需要登录后才可以回帖 登录 | 注册

JBTALKS.CC |联系我们 |隐私政策 |Share

GMT+8, 2025-12-31 10:09 PM , Processed in 0.092274 second(s), 25 queries .

Powered by Discuz! X2.5 © 2001-2012 Comsenz Inc.

本论坛言论纯属发表者个人意见,与本论坛立场无关
Copyright © 2003-2012 JBTALKS.CC All Rights Reserved

Dedicated Server powered by iCore Technology Sdn. Bhd.

合作联盟网站:
JBTALKS 马来西亚中文论坛 | JBTALKS我的空间 | ICORE TECHNOLOGY SDN. BHD.
回顶部