网页上会显示一个空格 [英] A blank space appears on the webpage
问题描述
这是我的表单,我使用此表单在用户点击它时接受输入
<?php
global $ row6;
$ query =select s.name,s1.price from services s,seller_services s1 where s1.service_id = s.id;;
$ result = mysqli_query($ conn3,$ query)或die(mysqli_error($ conn3));
while($ row6 = mysqli_fetch_array($ result))
{
?>
< div class =col-md-3 col-sm-4>
< div class =pro-box>
< div class =pro-thumb>< img src =https://udemy-images.udemy.com/course/240x135/1192700_6496_2.jpgalt =>< / DIV>
< div class =pro-txt> < a href =#class =add2cart> < / a>
< h6>< a href =manageservice.php><?php echo $ row6 ['name'];?>< / a>< / h6>
< p class =price> <?php echo $ row6 ['price'];?>< / p>
< form action =manageservice.phpmethod =POST>
< input type =submithidden =idvalue =buynamw =buy/>
< / form>
< div class =pro-rating>< a href =#> < / A>< / DIV>
< / div>
< / div>
< / div>
<?php}?>
和接下来我有一个页面manageservices.php,其中这个id应该继续clciking,现在应该发生的是所有用户都将这个服务id映射到相应的表seller_services中必须显示。
< div class =team-page>
< div class =container>
< div class =row>
<?php
global $ row;
if(isset($ _ POST ['buy']))
{
$ id = $ _ POST ['id'];
$ query5 =从服务中选择*,其中id ='$ id';;
$ result = mysqli_query($ conn3,$ query5)或die(Mysql error);
while($ row = mysqli_fetch_array($ result))
{
?>
<?php}?>
<! - Team Box Start - >
< div class =col-md-3 col-sm-6>
< div class =team-box>
< div class =thumb>
< div class =team-hover>
< h6> Michelle WU< / h6>
< p> Aliquam nec finibus dui,eget dapibus leo。 Suspendisse aliquam,justo in venenatis congue,sem odio vestibulum lorem,quis consectetur arcu nulla in est。< / p>
< div class =mayor-social> < a class =fbhref =#> < / a> < a class =twhref =#> < / a> < a class =linhref =#> < / a> < a class =ythref =#> < / a> < / DIV>
< / div>
< img src =images / timg-1.jpgalt =>< / div>
< div class =team-txt>
< h5><?php echo $ row ['name'];?>< / h5>
< p><?php echo $ row ['email'];?>< / p>
< / div>
< / div>
i在查询编写方面不是很好,而且页面只显示一个blak屏幕
这里是要使用的数据库表:
1.table将用户ID与服务ID相关
`seller_services`(
`id` int (11)NOT NULL AUTO_INCREMENT,
`service_id`int(50)NOT NULL,
`subservice_id`int(50)NOT NULL,
`price` int(50)NOT NULL,
`time` varchar(50)NOT NULL,
`user_id`int(50)NOT NULL,
`shop_id`int(50)NOT NULL,
PRIMARY KEY(`id `)
)
2.table服务
`services`(
`id `int(11)NOT NULL AUTO_INCREMENT,
`name` varchar(255)NOT NULL,
`image`varchar(255)NOT NULL,
PRIMARY KEY(`id`)
)
表用户:
`users`(
`id`int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(191)COLLATE utf8mb4_unicode_ci NOT NULL,
`mail` varchar(191)COLLATE utf8mb4 _unicode_ci NOT NULL,
`password` varchar(191)COLLATE utf8mb4_unicode_ci NOT NULL,
`sensity`varchar(191)COLLATE utf8mb4_unicode_ci NOT NULL,
`phone` varchar(191)COLLATE utf8mb4_unicode_ci NOT NULL,
`photo` varchar(191)COLLATE utf8mb4_unicode_ci NOT NULL,
`admin`int(11)NOT NULL,
`recore_token` varchar(100)COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at`timestamp NULL DEFAULT NULL,
`related_at`timestamp NULL DEFAULT NULL,
PRIMARY KEY(`id`),
UNIQUE KEY`users_email_unique`(`email`)
)
我的尝试:
i已经显示了我在上面的代码中尝试了我只需要查询帮助,并显示白色空白
row6;
query =select s.name,s1.price from services s,seller_services s1 where s1.service_id = s.id;;
result = mysqli_que RY(
This here is my form and i am using this form to take the input when a user clicks on it
<?php global $row6; $query= "select s.name ,s1.price from services s ,seller_services s1 where s1.service_id = s.id;"; $result= mysqli_query($conn3,$query) or die(mysqli_error($conn3)); while($row6=mysqli_fetch_array($result)) { ?> <div class="col-md-3 col-sm-4"> <div class="pro-box"> <div class="pro-thumb"><img src="https://udemy-images.udemy.com/course/240x135/1192700_6496_2.jpg" alt=""></div> <div class="pro-txt"> <a href="#" class="add2cart"></a> <h6><a href="manageservice.php"><?php echo $row6['name'];?></a></h6> <p class="price"><?php echo $row6['price'];?></p> <form action="manageservice.php" method="POST"> <input type="submit" hidden="id" value="buy" namw="buy"/> </form> <div class="pro-rating"><a href="#"> </a></div> </div> </div> </div> <?php } ?>
and next i have a page manageservices.php where this id shoould go on clciking and now what should happen is all the users having that service id mapped in the corresponding table seller_services must be displayed .
<div class="team-page"> <div class="container"> <div class="row"> <?php global $row; if(isset($_POST['buy'])) { $id=$_POST['id']; $query5= "Select *from services where id = '$id'; "; $result=mysqli_query($conn3,$query5) or die("Mysql error"); while($row=mysqli_fetch_array($result)) { ?> <?php } ?> <!--Team Box Start--> <div class="col-md-3 col-sm-6"> <div class="team-box"> <div class="thumb"> <div class="team-hover"> <h6>Michelle WU</h6> <p>Aliquam nec finibus dui, eget dapibus leo. Suspendisse aliquam, justo in venenatis congue, sem odio vestibulum lorem, quis consectetur arcu nulla in est. </p> <div class="mayor-social"> <a class="fb" href="#"></a> <a class="tw" href="#"></a> <a class="lin" href="#"></a> <a class="yt" href="#"></a> </div> </div> <img src="images/timg-1.jpg" alt=""></div> <div class="team-txt"> <h5><?php echo $row['name'];?></h5> <p><?php echo $row['email'];?></p> </div> </div>
i am not that good at query writing and also the page just shows a blak screen
here is the databse tables to be used :
1.table relating user id with service id
`seller_services` ( `id` int(11) NOT NULL AUTO_INCREMENT, `service_id` int(50) NOT NULL, `subservice_id` int(50) NOT NULL, `price` int(50) NOT NULL, `time` varchar(50) NOT NULL, `user_id` int(50) NOT NULL, `shop_id` int(50) NOT NULL, PRIMARY KEY (`id`) )
2.table services
`services` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `image` varchar(255) NOT NULL, PRIMARY KEY (`id`) )
table users:
`users` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `gender` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `phone` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `photo` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `admin` int(11) NOT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `users_email_unique` (`email`) )
What I have tried:
i have shown u what i tried in the above code i just need help in query and with the white blank space it shows
row6;
query= "select s.name ,s1.price from services s ,seller_services s1 where s1.service_id = s.id;";
result= mysqli_query(
这篇关于网页上会显示一个空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!