简体   繁体   English

数据库管理PHP MySQL

[英]Database management php mysql

I started learning Php scripting today only,i want to create an auction website for my college. 我今天才开始学习PHP脚本,我想为我的大学创建一个拍卖网站。 I have a bid table having the following columns: 我有一个包含以下各列的出价表:

  • Userid 用户身份
  • Itemid 物品编号
  • Bidamount 比达蒙特

When a user logs in ,and goes to "Items.php" page and when he will click on the bid option on an item (each item has an itemid )he will be redirected to "bid.php" page. 当用户登录并进入“ Items.php”页面时,当他单击某个项目(每个项目都有一个itemid )的出价选项时,他将被重定向到“ bid.php”页面。
My doubt is: I will get the useid by $_SESSION['userid'] , will i similarly also get the itemid automatically by the $_SESSION['itemid'] , if not how do i pass the itemid to the bid.php page. 我的疑问是:我将通过$_SESSION['userid']获取useid,同样,我也将通过$_SESSION['itemid']自动获取itemid,如果不是的话,我如何将itemid传递给bid.php页面。

another way is to to use an href tag to pass a variable to your bid.php and fetch it using get. 另一种方法是使用href标记将变量传递到bid.php并使用get进行获取。

ie <a href ="bid.php?id=1">Bid now!</a> <a href ="bid.php?id=1">Bid now!</a>

in your bid.php 在您的bid.php中

    $id = $_GET['id'];

you would create a from and use POST or GET information that is passed by the form. 您将创建一个from并使用表单传递的POST或GET信息。 you would not get this from session 你不会从会议上得到这个

here's a tutorial: http://www.tizag.com/phpT/postget.php 这是一个教程: http : //www.tizag.com/phpT/postget.php

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM