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; -
-
-
$query = "SELECT VRIJWILLIGER_ID, VOORNAAM, ACHTERNAAM, ADRES, POSTCODE, PLAATS, TELNUMMER, BESCHIKBAAR FROM VRIJWILLIGER";
-
$result = mysql_query($query)
-
or die("Er is een fout opgetreden");
-
-
$num=mysql_numrows($result);
-
?>
-
-
-
<table border="0" cellspacing="2" cellpadding="2">
-
<tr>
-
<th><font face="Arial, Helvetica, sans-serif">ID</font></th>
-
<th><font face="Arial, Helvetica, sans-serif">Voornaam</font></th>
-
<th><font face="Arial, Helvetica, sans-serif">Achternaam</font></th>
-
<th><font face="Arial, Helvetica, sans-serif">Adres</font></th>
-
<th><font face="Arial, Helvetica, sans-serif">Postcode</font></th>
-
<th><font face="Arial, Helvetica, sans-serif">Plaats</font></th>
-
<th><font face="Arial, Helvetica, sans-serif">Telefoon</font></th>
-
<th><font face="Arial, Helvetica, sans-serif">Beschikbaar</font></th>
-
</tr>
-
-
<?
-
$i=0;
-
while ($i < $num) {
-
-
$id=mysql_result($result,$i,"VRIJWILLIGER_ID");
-
$voornaam=mysql_result($result,$i,"VOORNAAM");
-
$achternaam=mysql_result($result,$i,"ACHTERNAAM");
-
$adres=mysql_result($result,$i,"ADRES");
-
$postcode=mysql_result($result,$i,"POSTCODE");
-
$plaats=mysql_result($result,$i,"PLAATS");
-
$telefoon=mysql_result($result,$i,"TELNUMMER");
-
$beschikbaar=mysql_result($result,$i,"BESCHIKBAAR");
-
-
-
-
-
if ($beschikbaar==1)
-
{ $beschikbaar = "YES, <a href=\"bookvolunteer.php?id=" . $row["id"] . "\">BOOK ME</a>";
-
-
}
-
else
-
{ $beschikbaar = "NO";
-
}
-
-
-
-
?>
-
-
-
<tr>
-
<td><font face="Arial, Helvetica, sans-serif"><? echo $id; ?></font></td>
-
<td><font face="Arial, Helvetica, sans-serif"><? echo $voornaam; ?></font></td>
-
<td><font face="Arial, Helvetica, sans-serif"><? echo $achternaam; ?></font></td>
-
<td><font face="Arial, Helvetica, sans-serif"><? echo $adres; ?></font></td>
-
<td><font face="Arial, Helvetica, sans-serif"><? echo $postcode; ?></font></td>
-
<td><font face="Arial, Helvetica, sans-serif"><? echo $plaats; ?></font></td>
-
<td><font face="Arial, Helvetica, sans-serif"><? echo $telefoon; ?></font></td>
-
<td><font face="Arial, Helvetica, sans-serif"><? echo $beschikbaar; ?></font></td>
-
</tr>
-
-
<?
-
$i++;
-
}
-
-
-
echo "</table>";
-
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: -
-
if ($beschikbaar==1)
-
{ $beschikbaar = "YES, <a href=\"bookvolunteer.php?id=" . $row["id"] . "\">BOOK ME</a>";
-
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?
3 1521
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:
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 -
$KijkLink = "<a href=\"bookvolunteer.php?id=" . $row["id"] . "\">BOOK ME</a>";
-
echo $KijkLink;
has become; - $Kijklink="<a href=\"bookvolunteer.php?id=" . $id . "\">BOOK ME</a>";
-
echo $Kijklink;
:)
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:
Sign in to post your reply or Sign up for a free account.
Similar topics |
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...
|
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
|
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 ?
|
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
|
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...
| |
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
--
|
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...
|
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;
|
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">
|
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...
|
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,...
| |
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...
|
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...
|
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...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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...
| |