473,671 Members | 2,608 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help needed with trying to make a detail page

14 New Member
hi

im pretty new in php (and programming at all), but for a project at school i need to make a festival-site where volunteers can sign up to work at a festival and those people can be 'reserved' by festival-owners to work at their festival.

okay..registrat ion system is done and its also possible already to show a list of volunteers that have been signed up, but now i'd like to make a page where festival-owners can see some extra details of the volunteers.

This is the code;

Expand|Select|Wrap|Line Numbers
  1.  
  2.  
  3. $query = "SELECT VRIJWILLIGER_ID, VOORNAAM, ACHTERNAAM, ADRES, POSTCODE, PLAATS, TELNUMMER, BESCHIKBAAR FROM VRIJWILLIGER";
  4.  $result = mysql_query($query)
  5.      or die("Er is een fout opgetreden");
  6.  
  7. $num=mysql_numrows($result);
  8. ?>
  9.  
  10.  
  11. <table border="0" cellspacing="2" cellpadding="2">
  12. <tr>
  13. <th><font face="Arial, Helvetica, sans-serif">ID</font></th>
  14. <th><font face="Arial, Helvetica, sans-serif">Voornaam</font></th>
  15. <th><font face="Arial, Helvetica, sans-serif">Achternaam</font></th>
  16. <th><font face="Arial, Helvetica, sans-serif">Adres</font></th>
  17. <th><font face="Arial, Helvetica, sans-serif">Postcode</font></th>
  18. <th><font face="Arial, Helvetica, sans-serif">Plaats</font></th>
  19. <th><font face="Arial, Helvetica, sans-serif">Telefoon</font></th>
  20. <th><font face="Arial, Helvetica, sans-serif">Beschikbaar</font></th>
  21. </tr>
  22.  
  23. <?
  24. $i=0;
  25. while ($i < $num) {
  26.  
  27. $id=mysql_result($result,$i,"VRIJWILLIGER_ID");
  28. $voornaam=mysql_result($result,$i,"VOORNAAM");
  29. $achternaam=mysql_result($result,$i,"ACHTERNAAM");
  30. $adres=mysql_result($result,$i,"ADRES");
  31. $postcode=mysql_result($result,$i,"POSTCODE");
  32. $plaats=mysql_result($result,$i,"PLAATS");
  33. $telefoon=mysql_result($result,$i,"TELNUMMER");
  34. $beschikbaar=mysql_result($result,$i,"BESCHIKBAAR");
  35.  
  36.  
  37.  
  38.  
  39. if ($beschikbaar==1)
  40. { $beschikbaar = "YES, <a href=\"bookvolunteer.php?id=" . $row["id"] . "\">BOOK ME</a>"; 
  41.  
  42. }
  43. else
  44. { $beschikbaar = "NO";
  45. }
  46.  
  47.  
  48.  
  49. ?>
  50.  
  51.  
  52. <tr>
  53. <td><font face="Arial, Helvetica, sans-serif"><? echo $id; ?></font></td>
  54. <td><font face="Arial, Helvetica, sans-serif"><? echo $voornaam; ?></font></td>
  55. <td><font face="Arial, Helvetica, sans-serif"><? echo $achternaam; ?></font></td>
  56. <td><font face="Arial, Helvetica, sans-serif"><? echo $adres; ?></font></td>
  57. <td><font face="Arial, Helvetica, sans-serif"><? echo $postcode; ?></font></td>
  58. <td><font face="Arial, Helvetica, sans-serif"><? echo $plaats; ?></font></td>
  59. <td><font face="Arial, Helvetica, sans-serif"><? echo $telefoon; ?></font></td>
  60. <td><font face="Arial, Helvetica, sans-serif"><? echo $beschikbaar; ?></font></td>
  61. </tr>
  62.  
  63. <?
  64. $i++;
  65. }
  66.  
  67.  
  68. echo "</table>";
  69.  
the variables are dutch so most ppl cant probably read only half of it..but i need to know how to be able to go to a page where i can read contact-details of a volunteer.

i think i need a code like this:

Expand|Select|Wrap|Line Numbers
  1.  
  2. if ($beschikbaar==1)
  3. { $beschikbaar = "YES, <a href=\"bookvolunteer.php?id=" . $row["id"] . "\">BOOK ME</a>"; 
  4.  
so when people click on "BOOK ME", they would go to the bookvolunteer.p hp page using the ID of the person where the link was printed next to,,,but that doesnt work. the url stays empty like this "http://www.yourdomain. com/bookvolunteer.p hp?id="

how can i fix this?
Oct 10 '06 #1
3 1521
ronverdonk
4,258 Recognized Expert Specialist
Why are you re-arranging the $beschikbaar variable from integer to char, as in [php]if ($beschikbaar== 1)
{ $beschikbaar = "YES, <a href=\"bookvolu nteer.php?id=" . $row["id"] . "\">BOOK ME</a>"; [/php]
You can do it like this (3 methods):[php]
// if you want the value to be enclosed in quotes and echo it later:
if ($beschikbaar== 1)
$KijkLink = "<a href=\"bookvolu nteer.php?id='" . $row["id"] . "'\">BOOK ME</a>";
echo $KijkLink;
// if you do not want the value to be enclosed in quotes and echo it later:
if ($beschikbaar== 1)
$KijkLink = "<a href=\"bookvolu nteer.php?id=" . $row["id"] . "\">BOOK ME</a>";
echo $KijkLink;
// if you want to echo straight away:
if ($beschikbaar== 1)
echo "<a href=\"bookvolu nteer.php?id=" . $row["id"] . "\">BOOK ME</a>";
[/php]
Btw, Dutch is acceptable to me! Veel plezier met het festival.

Ronald :cool:
Oct 11 '06 #2
warezguy05
14 New Member
thanks for your input Ronald. although your suggestions didn't work out properly for me..i had to adjust the code a little bit, and now it works well :)

i had to put the dollar-sign before 'id' and remove the row-stuff


Expand|Select|Wrap|Line Numbers
  1. $KijkLink = "<a href=\"bookvolunteer.php?id=" . $row["id"] . "\">BOOK ME</a>";
  2. echo $KijkLink;

has become;

Expand|Select|Wrap|Line Numbers
  1. $Kijklink="<a href=\"bookvolunteer.php?id=" . $id . "\">BOOK ME</a>"; 
  2. echo $Kijklink;
:)
Oct 12 '06 #3
ronverdonk
4,258 Recognized Expert Specialist
If you place a php variable in a double quoted string, you don't have to use concatenation, so your statement becomes:
[PHP]$Kijklink="<a href=\"bookvolu nteer.php?id=$i d\">BOOK ME</a>";
echo $Kijklink;[/PHP]

Ronald :cool:
Oct 12 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1665
by: robert4 | last post by:
I am new to CSS and am trying new things and am stuck at 4 am. The site in question is http://www.robert4.com/test/fitting.html It is just a test page for me to practice with for a bit. My goal is to have a pad on the page with a different background color to offset the middle content. I also want to butt the logo and the header together but there is a gap between them. If I use absolute positioning my problem is what happens in...
8
5466
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I debug it in PHP designer, it works with no problems, I get the test email. If
10
1905
by: Bob Bedford | last post by:
In the attempt to keep the URL and code quite clean, and avoid to have a very loooong url, we have used $_session for storing values trough the pages. Now, we have some clients that doesn't get any result when going on the second page. After studying their browser, the confidentiality setting was at the maximum. On their settings, the site doesn't work well. Since we can't change the setting for every client, what may we do ?
3
3172
by: buck | last post by:
reports/ can we alternate formatting such as "no shading" and then "shading" for multiple records such as a phone directory in Access2000 reports
15
2083
by: DavidS | last post by:
Have Visual Studio.NET installed on MS 2000 Professional OS laptop. No issue ever with web development and SQL connections. Purchased new laptop with XP Professional SP2!!!!!!!! & Visual Studio.NET installed. Nothing but headaches. Continually getting System.Data.SqlClient.SqlException : Timeout expired message - The timeout period elapsed prior to completion of the operation or the server is not responding. Can anyone help with...
0
1655
by: Gawn | last post by:
Dear all, Greeding from Thailand. Need help for my news script. I am trying to display news which keywords match the current page keywords. I am using Dreamweaver 8 and PhpMyAdmin to manage MySQL. May I explain you what I have done. My database and data in that look like this. //* Data Base -- phpMyAdmin SQL Dump -- version 2.6.2-pl1 -- http://www.phpmyadmin.net --
8
6709
by: babyangel43 | last post by:
Hello, I have a query set up in Access. I run it monthly, changing "date of test". I would like this query to be merged with a Word document so that the cover letter is created in Word, the fields from Access are automatically filled into the Word document. The query could be anywhere from 0-5000 names, one cover letter per name. AND to this cover letter for each applicant, there has to be attached a two page document. How in the world can...
13
1836
by: DDragon | last post by:
ok here is the problem, i have to forms which have values i wish to be added together i can add together the values in one form all right but im having problems with adding the values of the other form to it... ill post the code for you to look at and try to explaine in detail what im trying to do. here is the code (HTML and Javascript so you get the whole picture): Javascript: var gen, lights; var lammount;
53
8372
by: souporpower | last post by:
Hello All I am trying to activate a link using Jquery. Here is my code; <html> <head> <script type="text/javascript" src="../../resources/js/ jquery-1.2.6.js"</script> <script language="javascript" type="text/javascript">
0
8485
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8403
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8930
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8677
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6238
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5704
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4227
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4417
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.