473,398 Members | 2,393 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Help needed with trying to make a detail page

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..registration 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.php 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.php?id="

how can i fix this?
Oct 10 '06 #1
3 1506
ronverdonk
4,258 Expert 4TB
Why are you re-arranging the $beschikbaar variable from integer to char, as in [php]if ($beschikbaar==1)
{ $beschikbaar = "YES, <a href=\"bookvolunteer.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=\"bookvolunteer.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=\"bookvolunteer.php?id=" . $row["id"] . "\">BOOK ME</a>";
echo $KijkLink;
// if you want to echo straight away:
if ($beschikbaar==1)
echo "<a href=\"bookvolunteer.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
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 Expert 4TB
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=\"bookvolunteer.php?id=$id\">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
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...
8
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 -------------------------------------------------------------------------------- ...
10
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...
3
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
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...
0
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....
8
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...
13
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...
53
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.